; ; Dabble with SC/MP. ; ; Author doug rice ; ; usage: ./rcasm test4.asm -l -h -t ; ; use simulator:- ; ; This code puts a constant onto the hex display ; ; start: 8060{ ; ; Try and write someting to the display at 0d00h ; ; Disp: equ 0d00H ChRom: equ 010bH org 0f20H jmp loop2 t: db 0 cnt1: DB 0 cnt2: DB 0 keys: DB 0 lastkeys: DB 0 t2: db 0 loop2: ; reload display pointer. LDI Disp.0 XPAL 1 LDI Disp.1 XPAH 1 ; read switches and put onto the display ldr keys str lastkeys ; read switch LD 0(1) str keys xri 0ffh andr lastkeys ; xorr lastkeys ; 1's represent keys pressed. jz loop2a ildr cnt1 str cnt1 loop2a: ldr cnt1 st @+1(1) dly 10 ; LD 0(1) ; xri -1 ; st @+1(1) ; dly 10 ; LD 0(1) ; st @+1(1) ; dly 10 ; set pointer o Character rom @ 0x010b LDI ChRom.1 XPAH 2 ; load cnt in xpal and use offset ldr cnt1 ani 0Fh XPAL 2 ld ChRom.0(2) ; store onto display st @+1(1) dly 10 ; set pointer o Character rom @ 0x010b LDI ChRom.0 XPAL 2 LDI ChRom.1 XPAH 2 ; store onto display ldr 0 st @+1(1) dly 10 ;nop ;ldi 055h ; increment accumulator and store to display ldi 005h xae ; ; use value in E to lot up 7Seg ld -128(2) ; store onto display st @+1(1) dly 10 ldi 002h xae ; use value in E to lot up 7Seg ld -128(2) ; store onto display st @+1(1) dly 10 ldi 008h xae ; use value in E to lot up 7Seg ld -128(2) ; store onto display st @+1(1) ldi 000h xae ; use value in E to lot up 7Seg ld -128(2) ; store onto display st @+1(1) loop3: jmp loop2 Stop: xppc 3 jmp stop }