GALB ASM ;GAL-BRENNER FUER BASIC
;Adresse 0: UP-Nummer
; 1: Parameter oder Ergebnis
BEGIN LD A,(0)
LD B,A
DJNZ GALRD
LD A,(1)
LD (TYPE),A
LD BC,780H
MOSU INC B
RET Z
IN A,(C)
LD E,0C0H
CP 0CEH
JR Z,FND1
LD E,4
CP 0EFH
JR NZ,MOSU
FND1 LD A,1
OUT (C),A
LD A,E
LD (PORT),A
LD C,A
XOR A
OUT (C),A
INC C
OUT (C),A
INC C
DEC A
OUT (C),A
INC A
OUT (C),A
INC C
DEC A
OUT (C),A
LD A,2
OUT (C),A
LD HL,FUSEMAP
LD BC,339
GTYP1 LD M,0FFH
CPI
RET PO
JR GTYP1
GALRD
DJNZ GALPRG
JR GALRD0
RET
GALPRG
DJNZ GALCMP
;Brennen
CALL EDITONB
LD HL,0
LD A,(TYPE)
OR A
LD B,32
JR Z,GALBR1
LD B,40
;Fusemap
GALBR1 PUSH HL
PUSH BC
CALL BRLINE
POP BC
POP HL
INC L
DJNZ GALBR1
;Signatur
LD A,(TYPE)
OR A
LD HL,2056
LD A,32
JR Z,GALBR2
LD HL,2568
LD A,40
GALBR2 OUT (C),A
LD B,64
GALBR3 CALL SH1OUT
INC HL
DJNZ GALBR3
CALL IMPULSB
;Architektursteuerwort ACW
LD A,60
OUT (C),A
CALL ACWHAND
CALL IMPULSB
JP EDITOFF
GALCMP
DJNZ BLKERA
LD HL,0
LD (1),HL
GALRD0 ;Lesen oder Vergleichen
CALL EDITONR
LD HL,0
LD A,(TYPE)
OR A
LD B,32
JR Z,GALRD1
LD B,40
;Fusemap
GALRD1 PUSH HL
PUSH BC
CALL RCLINE
POP BC
POP HL
INC L
DJNZ GALRD1
;Signatur
LD A,(TYPE)
OR A
LD HL,2056
LD A,32
JR Z,GALRD2
LD HL,2568
LD A,40
GALRD2 OUT (C),A
CALL IMPULSR
LD B,64
GALRD3 CALL SH1OUT
INC HL
DJNZ GALRD3
;Architektursteuerwort ACW
LD A,60
OUT (C),A
CALL IMPULSR
CALL ACWHAND
JP EDITOFF
;**************************
BLKERA
DJNZ JSAVE
CALL EDITONB
LD A,63
OUT (C),A
XOR A
DEC A
CALL SHDIN
CALL IMPULSB
CALL EDITOFF
RET
JSAVE
DJNZ BITRD
IN A,88H
BIT 2,A
JR NZ,SAVPG
CALL 0F018H
CALL SAVPG
CALL 0F01BH
RET
SAVPG
LD HL,TYPE
LD (0B782H),HL
LD A,M
OR A
LD HL,FUSEMAP+275
JR Z,SAVPG1
LD HL,FUSEMAP+339
SAVPG1 LD (0B784H),HL
LD A,2
LD (0B781H),A
LD HL,(1)
CALL 0F003H
DEFB 36H
RET
BITRD
DJNZ BITSET
CALL ADDR
AND M
LD HL,0
JR Z,BITRD1
DEC HL
BITRD1 LD (1),HL
RET
BITSET
DJNZ RESBIT
CALL ADDR
OR M
LD M,A
RET
RESBIT
DJNZ SECUR
CALL ADDR
CPL
AND M
LD M,A
RET
SECUR
DJNZ UPFLT
CALL EDITONB
LD A,61
OUT (C),A
XOR A
CALL SHDIN
CALL IMPULSB
CALL EDITOFF
RET
UPFLT
LD HL,-1
LD (1),HL
RET
ACWHAND ;ACW-gemeinsames UP
LD DE,8
ADD HL,DE
LD B,32
GALRD4 CALL SH1OUT ;PTF
INC HL
DJNZ GALRD4
LD DE,-32-8-64-8
ADD HL,DE
LD B,4
GALRD5 CALL SH1OUT ;XOR
INC HL
DJNZ GALRD5
LD DE,4+64+8+64+2
ADD HL,DE
CALL SH1OUT ;AC0
LD DE,-2-64-8
ADD HL,DE
LD B,8
GALRD6 CALL SH1OUT ;AC1
INC HL
DJNZ GALRD6
LD DE,64+1
ADD HL,DE
CALL SH1OUT ;SYN
LD DE,-1-64-8-64-4
ADD HL,DE
LD B,4
GALRD7 CALL SH1OUT ;XOR
INC HL
DJNZ GALRD7
LD DE,64+8+32
ADD HL,DE
LD B,32
GALRD8 CALL SH1OUT ;PTF
INC HL
DJNZ GALRD8
RET
ADDR ;berechnet Adresse aus (1)
;um in HL=Adr und A=Bitregister
LD HL,(1)
ADDR0 LD A,L
AND 7
LD B,A
INC B
LD A,80H
ADDR2 RLCA
DJNZ ADDR2
LD B,3
ADDR1 SRL H
RR L
DJNZ ADDR1
LD DE,FUSEMAP
ADD HL,DE
RET
SH1IN ;1 Einzelbit einschieben
LD A,E
AND M
CALL SHDIN
POP HL
RET
BRLINE ;C ist immer Portadresse!
OUT (C),L
CALL ADDR0
LD E,A
LD B,64
BRLIN1 LD A,E
AND M
CALL SHDIN ;Z-Flag
INC HL
INC HL
INC HL
INC HL
DJNZ BRLIN1
CALL IMPULSB
RET
SH1OUT ;1 Einzelbit auslesen oder
;vergleichen ODER einschieben
;PE:HL:JEDEC-Adresse
PUSH HL
PUSH BC
CALL ADDR0
POP BC
LD E,A
LD A,(0)
CP 3
JR Z,SH1IN
CALL SHDOUT
CALL RCBIT
POP HL
RET
RCLINE ;liest oder vergleicht
OUT (C),L
CALL ADDR0
LD E,A
CALL IMPULSR
LD B,64
RCLIN1 CALL SHDOUT
CALL RCBIT
INC HL
INC HL
INC HL
INC HL
DJNZ RCLIN1
RET
RCBIT ;Lese oder teste Bit
;PE: E:Bitnummer
LD A,(0)
CP 2
JR Z,READ
LD A,M
XOR D
AND E
CALL NZ,UPFLT
RET
READ LD A,D
AND E
LD D,A
LD A,E
CPL
AND M
OR D
LD M,A
RET
SHDOUT ;Bit ausschieben
INC C
IN A,(C)
DEC C
RRA
RRA
SBC A
LD D,A
IN A,(C)
JR SHDO1
SHDIN ;Z-Flag-Komplement einschieben
JR Z,BRRES
IN A,(C)
SET 7,A
JR BRSET
BRRES IN A,(C)
RES 7,A
BRSET OUT (C),A
SHDO1 SET 6,A
OUT (C),A
NOP
NOP
RES 6,A
OUT (C),A
RET
IMPULSB ;Programmierimpuls
INC C
IN A,(C)
RES 0,A
OUT (C),A
LD B,0
W10MS PUSH AF
POP AF
PUSH AF
POP AF
PUSH AF
POP AF
DJNZ W10MS
IMPULSE SET 0,A
OUT (C),A
DEC C
RET
IMPULSR ;Leseimpuls
INC C
IN A,(C)
RES 0,A
OUT (C),A
JR IMPULSE
EDITONR ;Lesespannungen anlegen
LD A,(PORT)
LD C,A
INC C
LD A,10H
OUT (C),A
INC A
OUT (C),A
SET 6,A
OUT (C),A
DEC C
RET
EDITONB ;Brennspannungen anlegen
CALL EDITONR
INC C
SET 7,A
OUT (C),A
DEC C
RET
EDITOFF ;Spannungen aus
XOR A
OUT (C),A
INC C
LD A,51H
OUT (C),A
RES 6,A
OUT (C),A
DEC A
OUT (C),A
XOR A
OUT (C),A
RET
DEFW 7F7FH
DEFM 'GAL'
DEFB 1
OR A
JR Z,HINWEIS
LD A,L
LD (0),A
LD (1),DE
CALL BEGIN
LD HL,(1)
CALL 0F003H
DEFB 1AH
RET
HINWEIS
CALL 0F003H
DEFM '#UP-Nummer Parameter'
DEFW 0D0AH
NOP
RET
PORT DEFB 0
TYPE DEFB 0
FUSEMAP ;
: GC: 2×2€ÈíxÀþÎ(þï ð>íy{2Ö2O¯íyíy=íy<íy=íy>íy!Ø2S6ÿí¡àøNÉCÍ‚2! :×2· ((åÅÍÏ1Áá,õ:×2·!
Detected encoding: UTF-8 | 0
|