Category : Assembly Language Source Code
Archive   : ZAD.ZIP
Filename : ZADEX.SRC

 
Output of file : ZADEX.SRC contained in archive : ZAD.ZIP
;This EXAMPLE PROGRAM is meant to illustrate the use of
;pseudo-ops in assembly language programming and has no
;other function or purpose.

;-------DEFINITION OF CONSTANTS------------------------
;
OUTCDE EQU 80H ;OUTPUT CNTL CODE FOR 8255A
CNTLPT EQU 0C3H ;CONTROL PORT ADDRESS
DATAPT EQU 0C0H ;DATA PORT ADDRESS
TIMECN EQU 100D ;100MS TIME CONSTANT

;-------LINKAGES TO SUBROUTINES------------------------
;
DELAY EQU 0FFDH ;LINKAGE TO DELAY SUBROUTINE
MESOUT EQU 0FF4H ;LINKAGE TO MESSAGE SUBROUTINE

;-------PROGRAM STARTS HERE----------------------------
ORG 1800H ;PROGRAM LOAD ADDRESS

START: LD A,OUTCDE ;LOAD CNTL CODE FOR OUTPUT
OUT (CNTLPT),A ;TRANSMIT CNTL CODE TO 8255A
LD C,10D ;INIT LOOP1 INDEX
LD HL,TBSTRT ;POINT HL TO START OF TABLE
LD (STORE),HL ;SAVE POINTER IN MEMORY

LOOP1: LD A,10000001B ;INIT LAMP PATTERN FOR LEDS
OUT (DATAPT),A ;TRANSMIT LED DATA TO 8255A
LD HL,TIMECN ;INIT HL WITH TIME CONSTANT
CALL DELAY ;EXECUTE 100MS DELAY
XOR A ;CLEAR ACC
OUT (DATAPT),A ;TURN OFF LEDS AFTER DELAY

LD B,TBEND-TBSTRT ;INIT LOOP2 INDEX
LD HL,(STORE) ;POINT TO BEGN OF TABLE
LOOP2: LD A,(HL) ;GET A BYTE
OUT (DATAPT),A ;OUTPUT IT TO PORT
INC HL ;ADV DATA POINTER
DJNZ LOOP2 ;REPEAT UNTIL ALL BYTES OUT

DEC C ;ADJUST LOOP1 INDEX
JP NZ,LOOP1 ;REPEAT UNTIL 10 LOOPS DONE

LD HL,MESG ;POINT TO "DONE" MESSAGE
CALL MESOUT ;TRANSMIT IT TO DISPLAY
HALT ;FINISHED WITH PROGRAM

STORE: DEFS 2 ;ALLOCATE TWO BYTES FOR --
; STORAGE OF TABLE PNTR

;-------DATA AND MESSAGES------------------------------
;
TBSTRT: DEFB 12H,5AH,0D5H,0FFH,4EH,01H ;DATA TABLE
TBEND: ;END ADR OF TABLE
MESG: DEFM 'DONE ' ;MESSAGE STORAGE



  3 Responses to “Category : Assembly Language Source Code
Archive   : ZAD.ZIP
Filename : ZADEX.SRC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/