General Category > Programming

Example Z80 assembly programs (was:ASM source code)

<< < (35/35)

issalig:
Hi  @Urusergi , I have a question about the code, why 170+code_size is copied 4 times?


--- Quote from: Urusergi on 23:10, 27 March 18 ---@AMSDOS Here is your Basic example  8)


--- Code: ---kl_rom_select equ &B90F

ORG &A000

LD HL,Data
LD DE,&0170  ; Basic start
LD BC,EndData-Data
LDIR

ld hl,(length)
ld c,0
call kl_rom_select
ld a,(&c002)
cp 0
jp z,cpc464
ld (&ae66),hl
ld (&ae68),hl
ld (&ae6a),hl
ld (&ae6c),hl
cp 1
jp z,cpc664
jp &ea78        ;; run BASIC CPC6128
.cpc664
jp &ea7d        ;; run BASIC CPC664
.cpc464
ld (&ae83),hl
ld (&ae85),hl
ld (&ae87),hl
ld (&ae89),hl
jp &e9bd        ;; run BASIC CPC464


;PRINT HEX$(PEEK(&AE67))
;PRINT HEX$(PEEK(&AE66))
length dw &01AC ; Address of start of variables (&AE66-67 in cpc6128-664, &AE83-84 in cpc464)

.Data
DB &0D,&00,&0A,&00,&02,&00,&00,&E1
DB &EF,&1A,&E8,&03,&00,&0D,&00,&14
DB &00,&02,&00,&00,&E2,&EF,&1A,&00
DB &01,&00,&10,&00,&1E,&00,&BF,&20
DB &02,&00,&00,&E1,&F4,&02,&00,&00
DB &E2,&00,&0A,&00,&28,&00,&BF,&22
DB &38,&29,&22,&00,&06,&00,&32,&00
DB &98,&00,&00,&00
.EndData
--- End code ---

--- End quote ---

Urusergi:

--- Quote from: issalig on 17:58, 08 June 21 ---Hi  @Urusergi , I have a question about the code, why 170+code_size is copied 4 times?
--- End quote ---


Hi, those four memory locations must have the same data. You can find out what they mean in this web page:

http://www.cantrell.org.uk/david/tech/cpc/cpc-firmware/mem-use.htm


Look at &AE66, &AE68, &AE6A, &AE6C



Navigation

[0] Message Index

[*] Previous page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod