Epson S5U1C62000A Computer Hardware User Manual


 
S5U1C62000A MANUAL EPSON 85
(S1C60/62 FAMILY ASSEMBLER PACKAGE)
CHAPTER 5: ASSEMBLER
5.10 Sample Executions
Command line
C:\E0C62\bin\as62 -g -e -l main.s
Assembly source file
; main.s
; test program (main routine)
;
;***** INITIAL SP ADDRESS DEFINITION *****
#define SP_INIT_ADDR 0x80 ;SP init addr = 0x80
;***** BOOT, LOOP *****
.global INIT_RAM_BLK1 ; subroutine
.global INC_RAM_BLK1 ; subroutine
.org 0x100
BOOT:
ld a,SP_INIT_ADDR>>4 ; set SP
ld sph,a
ld a, SP_INIT_ADDR&0xf
ld spl,a
call INIT_RAM_BLK1 ; initialize RAM block 1
LOOP:
call INC_RAM_BLK1 ; increment RAM block 1
jp LOOP ; infinity loop
;***** RAM block *****
.bss
.org 0x000
.comm RAM_BLK1, 4
Preprocessed file
.stabs "C:\E0C62\test\main.s", FileName
; main.s
; test program (main routine)
;
;***** INITIAL SP ADDRESS DEFINITION *****
;#define SP_INIT_ADDR 0x80 ;SP init addr = 0x80
;***** BOOT, LOOP *****
.global INIT_RAM_BLK1 ; subroutine
.global INC_RAM_BLK1 ; subroutine
.org 0x100
.stabn 13, LineInfo
BOOT:
.stabn 14, LineInfo
ld a,0x80>>4 ; set SP
.stabn 15, LineInfo
ld sph,a
.stabn 16, LineInfo
ld a, 0x80&0xf
.stabn 17, LineInfo
ld spl,a
.stabn 18, LineInfo
call INIT_RAM_BLK1 ; initialize RAM block 1
.stabn 19, LineInfo
LOOP:
.stabn 20, LineInfo
call INC_RAM_BLK1 ; increment RAM block 1
.stabn 21, LineInfo
jp LOOP ; infinity loop
;***** RAM block *****
.bss
.org 0x000
.comm RAM_BLK1, 4
.stabn 0, FileEnd