×   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

BCD2 Pop String from Stack

Submitted by Steve Fewell

Description:

Get last byte from Stack, Store in &36 (Length of String, SWA). If length is zero
then increase Stack space by 1 (to remove length byte from Stack) & exit.
Otherwise, copy ?&36 number of bytes from the Stack to the SWA and then increase
Stack space by ?&36 + 1 bytes (to reclaim the space used by the String) and exit.


Disassembly for the Pop String from Stack routine

BCD2   178 004 B2 04 LDA (&04)
BCD4 6 133 054 85 36 STA &36
BCD6   240 011 F0 0B BEQ 11 --> &BCE3
BCD8   168 A8 TAY
BCD9   177 004 B1 04 LDA (&04),Y
BCDB   153 255 005 99 FF 05 STA &05FF,Y
BCDE   136 88 DEY
BCDF   208 248 D0 F8 BNE -8 --> &BCD9
BCE1   178 004 B2 04 LDA (&04)
BCE3 8 056 38 SEC
BCE4   128 023 80 17 BRA 23 --> &BCFD Move BASIC Stack pointer up A (plus carry) bytes (End of Pop Integer routine)

 


 Back to 8BS
Or