×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library



IWA = 8-bit or 16-bit Integer

Submitted by Steve Fewell

Routine: i16-bit
Name: IWA = 8-bit or 16-bit Integer
Starting Address: &AE62 for 16-bit value [or AE60 for 8-bit]
Entry criteria: A contains the least significant byte of the 16-bit number, Y contains the most significant byte of the 16-bit number.
[Y is always set to 0 when called from AE60, so only need to supply A].
Exit: IWA contains the 8-bit or 16-bit number [(256 * Y)  + A].

Description:
Stores an 8-bit [if called from AE60] or 16-bit [if called from AE62] number (The 16-bit value is represented by 2 individual bytes) into the IWA and sets the 2 most significant bytes (or in the case or an 8-bit value, the 3 most significant bytes) of the IWA to zero.

Disassembly for the IWA = 8-bit or 16-bit Integer routine

AE60

 

160 000

A0 00

LDY#&00

AE62

*

133 042

85 2A

STA &2A

AE64

+

132 043

84 2B

STY &2B

AE66

"d,"

100 044

64 2C

STZ &2C

AE68

d-

100 045

64 2D

STZ &2D

AE6A

@

169 064

A9 40

LDA#&40

AE6C

`

96

60

RTS

 


 Back to 8BS
Or