home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
dev
/
misc
/
flexcat
/
languages
/
schwäbisch.asm
< prev
next >
Wrap
Assembly Source File
|
1994-07-04
|
18KB
|
561 lines
*
* $VER: schwäbisch.language 38.2 (13.1.94)
* WARNING: BETA TEST VERSION!!!
*
include 'exec/types.i'
include 'exec/lists.i'
include 'exec/libraries.i'
include 'exec/resident.i'
include 'exec/initializers.i'
include 'libraries/locale.i'
_LVOFreeMem EQU -$d2
; Uncomment this to activate slovene ToUpper and StrCmp function.
;NO_SORT_EXTENSION SET 1
SECTION CODE
moveq #-1,d0
rts
Start dc.w RTC_MATCHWORD
dc.l Start
dc.l End
dc.b RTF_AUTOINIT
dc.b 38
dc.b NT_LIBRARY
dc.b 156
dc.l name
dc.l idStr
dc.l initTable
name dc.b 'schwäbisch.language',0
idStr dc.b 'schwäbisch 38.2 (29.3.94)',13,10,0
initTable
dc.l 42 ; library base size
dc.l vectors ; library routine vectors
dc.l structure ; library base initialization structure
dc.l InitFunction ; initialization function
vectors
dc.l FuncOpen
dc.l FuncClose
dc.l FuncExpunge
dc.l FuncNull
dc.l FuncMask
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncGetString
IFND NO_SORT_EXTENSION
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncNull
dc.l FuncToUpper
dc.l FuncStringCompare
ENDC
dc.l -1
structure
INITBYTE LN_PRI,156
INITBYTE LN_TYPE,NT_LIBRARY
INITLONG LN_NAME,name
INITBYTE LIB_FLAGS, LIBF_CHANGED ! LIBF_SUMUSED
INITWORD LIB_VERSION,38
INITWORD LIB_REVISION,2
INITLONG LIB_IDSTRING,idStr
dc.w 0
*- InitFunction ---------------------------------------------------*
* Input:
* D0 - catalog base
* A6 - execbase
* A0 - ???
*------------------------------------------------------------------*
InitFunction
move.l d0,a1 ; get catalog base
move.l a0,34(a1)
move.l a6,38(a1) ; save sysbase
rts
*- FuncOpen -------------------------------------------------------*
* Input:
* A6 - catalog base
* Output:
* D0 - catalog base
*------------------------------------------------------------------*
FuncOpen
addq.w #1,LIB_OPENCNT(a6) ; increase open counter
bclr #LIBB_DELEXP,LIB_FLAGS(a6) ; clear delayed expunge flag
move.l a6,d0 ; return catalog base
rts
*- FuncClose ------------------------------------------------------*
* Input:
* A6 - catalog base
* Output:
* D0 = 0
*------------------------------------------------------------------*
FuncClose
subq.w #1,LIB_OPENCNT(a6) ; decrease open counter
btst #LIBB_DELEXP,LIB_FLAGS(a6) ; test delayed expunge flag
bne.s .expunge ; expunge library if requested
moveq #0,d0
rts
.expunge
tst.w LIB_OPENCNT(a6) ; still open?
beq.s doExpunge ; expunge catalog
moveq #0,d0
rts
*- FuncExpunge ----------------------------------------------------*
* Input:
* A6 - catalog base
* Output:
* ???
*------------------------------------------------------------------*
FuncExpunge
tst.w LIB_OPENCNT(a6) ; catalog opened?
beq.s doExpunge ; expunge library
bset #LIBB_DELEXP,LIB_FLAGS(a6) ; set delayed expunge flag
moveq #0,d0
rts
doExpunge
movem.l d2/a5/a6,-(sp)
move.l a6,a5 ; get catalog base
move.l 38(a5),a6 ; get execbase
move.l 34(a5),d2
move.l a5,a1 ; get catalog base
REMOVE ; remove catalog node
move.l a5,a1 ; get catalog base
moveq #0,d0 ; clear d0
move.w LIB_NEGSIZE(a5),d0 ; get vector array size
sub.l d0,a1 ; get array start address
add.w LIB_POSSIZE(a5),d0 ; get catalog base size
jsr _LVOFreeMem(a6) ; free catalog base memory
move.l d2,d0
movem.l (sp)+,d2/a5/a6
rts
*- FuncNull -------------------------------------------------------*
FuncNull
moveq #0,d0
rts
*- FuncMask -------------------------------------------------------*
* Output:
* D0 = bitmask of implemented functions
* (f.e. D0 = 1<<3 means function 3 implemented -> function 3 = GetString)
*------------------------------------------------------------------*
FuncMask
; IFND NO_SORT_EXTENSION
; move.l #(1<<3|1<<15|1<<16),d0 ; GetString, ToUpper, StringCompare
; else
move.l #(1<<3),d0 ; GetString
; ENDC
rts
IFND NO_SORT_EXTENSION
*- FuncStringCompare ----------------------------------------------*
* Input:
* D0 - string length
* D1 - comparsion type
* A1 - first string
* A2 - second string
* Output:
* <0 means string1 < string2
* =0 means string1 = string2
* >0 means string1 > string2
*------------------------------------------------------------------*
FuncStringCompare
tst.l d0 ; zero length?
bne.s .oklen ; length specified
rts
.oklen tst.l d1 ; SC_ASCII?
bne.s doCol1 ; no, do SC_COLLATE1 or SC_COLLATE2
movem.l d2/a2,-(sp) ; save regs
lea convTab2(pc),a0 ; get comparison table pointer
moveq #0,d2
.next move.b (a1)+,d1 ; get character from first string
move.b (a2)+,d2 ; get character from second string
move.b (a0,d1.w),d1 ; get first comparison char from table
cmp.b (a0,d2.w),d1 ; compare with second comp. char
bne.s .lower ; are chars equal?
tst.b d1 ; end of string?
beq.s .equal
subq.l #1,d0 ; one less to go...
bne.s .next ; go to next character
movem.l (sp)+,d2/a2
rts
.equal moveq #0,d0 ; characters are equal
movem.l (sp)+,d2/a2
rts
.lower bhi.s .higher ; char1 > char2?
moveq #-1,d0 ; char1 < char2
movem.l (sp)+,d2/a2
rts
.higher moveq #1,d0 ; char1 > char2
movem.l (sp)+,d2/a2
rts
doCol1 subq.l #1,d1 ; SC_COLLATE1?
bne.s doCol2 ; no, do SC_COLLATE2
movem.l d2/a2,-(sp)
lea convTab1(pc),a0
moveq #0,d2
.next move.b (a1)+,d1
move.b (a2)+,d2
move.b (a0,d1.w),d1
cmp.b (a0,d2.w),d1
bne.s lbC0001AA
tst.b d1
beq.s lbC0001A2
subq.l #1,d0
bne.s .next
movem.l (sp)+,d2/a2
rts
lbC0001A2:
moveq #0,d0
movem.l (sp)+,d2/a2
rts
lbC0001AA:
bhi.s lbC0001B4
moveq #-1,d0
movem.l (sp)+,d2/a2
rts
lbC0001B4:
moveq #1,d0
movem.l (sp)+,d2/a2
rts
doCol2 subq.l #1,d1
bne.s lbC000226
movem.l d2/d3/a2,-(sp)
lea convTab1(pc),a0
moveq #0,d2
moveq #0,d3
lbC0001CC:
move.b (a1)+,d1
beq.s lbC0001E0
move.b (a2)+,d2
cmp.b d2,d1
bne.s lbC0001EC
subq.l #1,d0
bne.s lbC0001CC
movem.l (sp)+,d2/d3/a2
rts
lbC0001E0:
cmp.b (a2)+,d1
bne.s lbC0001EC
movem.l (sp)+,d2/d3/a2
moveq #0,d0
rts
lbC0001EC:
bhi.s lbC0001F2
moveq #-1,d3
bra.s lbC0001FA
lbC0001F2:
moveq #1,d3
bra.s lbC0001FA
lbC0001F6:
move.b (a1)+,d1
move.b (a2)+,d2
lbC0001FA:
move.b (a0,d1.w),d1
cmp.b (a0,d2.w),d1
bne.s lbC000214
tst.b d1
beq.s lbC00020C
subq.l #1,d0
bne.s lbC0001F6
lbC00020C:
move.l d3,d0
movem.l (sp)+,d2/d3/a2
rts
lbC000214:
bhi.s lbC00021E
moveq #-1,d0
movem.l (sp)+,d2/d3/a2
rts
lbC00021E:
moveq #1,d0
movem.l (sp)+,d2/d3/a2
rts
lbC000226:
moveq #0,d0
rts
*- FuncToUpper ----------------------------------------------------*
FuncToUpper
move.l d0,-(sp)
bne.s lbC000232
addq.l #4,sp
rts
lbC000232:
tst.l d1
bne.s lbC00023E
move.l a2,-(sp)
lea convTab2(pc),a0
bra.s lbC000252
lbC00023E:
subq.l #1,d1
bne.s lbC000262
move.l a2,-(sp)
lea convTab1(pc),a0
bra.s lbC000252
lbC00024A:
move.b (a1)+,d1
beq.s lbC000256
move.b (a0,d1.w),(a2)+
lbC000252:
subq.l #1,d0
bne.s lbC00024A
lbC000256:
clr.b (a2)
move.l (sp)+,a2
move.l (sp)+,d1
sub.l d0,d1
move.l d1,d0
rts
lbC000262:
subq.l #1,d1
bne.s lbC0002A4
movem.l d2/a2/a3,-(sp)
move.l a1,a0
lbC00026C:
tst.b (a0)+
bne.s lbC00026C
sub.l a1,a0
subq.l #1,a0
move.l a2,a3
add.l a0,a3
lea convTab1(pc),a0
bra.s lbC000292
lbC00027E:
move.b (a1)+,d1
beq.s lbC000296
move.b (a0,d1.w),d2
move.b d2,(a2)+
cmp.b d2,d1
beq.s lbC000292
move.b d1,(a3)+
subq.l #1,d0
beq.s lbC000296
lbC000292:
subq.l #1,d0
bne.s lbC00027E
lbC000296:
clr.b (a3)
movem.l (sp)+,d2/a2/a3
move.l (sp)+,d1
sub.l d0,d1
move.l d1,d0
rts
lbC0002A4:
moveq #0,d0
rts
*- convTab1 ------------------------------------------------------*
convTab1
dc.b $00,$01,$02,$03,$04,$05,$06,$07
dc.b $08,$09,$0A,$0B,$0C,$0D,$0E,$0F
dc.b $10,$11,$12,$13,$14,$15,$16,$17
dc.b $18,$19,$1A,$1B,$1C,$1D,$1E,$1F
dc.b $20,$21,$22,$23,$24,$25,$26,$27
dc.b $28,$29,$2A,$2B,$2C,$2D,$2E,$2F
dc.b $30,$31,$32,$33,$34,$35,$36,$37
dc.b $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
dc.b $40,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4A,$4B,$4C,$4D,$4E,$4F
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5A,$5E,$5F,$60,$61,$62
dc.b $63,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4A,$4B,$4C,$4D,$4E,$4F
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5A,$64,$65,$66,$67,$68
dc.b $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7
dc.b $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF
dc.b $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7
dc.b $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF
dc.b $20,$21,$24,$24,$69,$6A,$6B,$53
dc.b $6C,$6D,$6E,$22,$6F,$70,$71,$72
dc.b $73,$74,$75,$76,$77,$78,$79,$7A
dc.b $7B,$7C,$7D,$22,$7E,$7F,$80,$3F
dc.b $41,$41,$41,$41,$41,$5D,$5B,$43
dc.b $45,$45,$45,$45,$49,$49,$49,$49
dc.b $44,$4E,$4F,$4F,$4F,$4F,$4F,$2F
dc.b $5C,$55,$55,$55,$55,$59,$50,$59
dc.b $41,$41,$41,$41,$41,$5D,$5B,$43
dc.b $45,$45,$45,$45,$49,$49,$49,$49
dc.b $44,$4E,$4F,$4F,$4F,$4F,$4F,$2F
dc.b $5C,$55,$55,$55,$55,$59,$50,$59
*- convTab2 ------------------------------------------------------*
convTab2
dc.b $00,$01,$02,$03,$04,$05,$06,$07
dc.b $08,$09,$0A,$0B,$0C,$0D,$0E,$0F
dc.b $10,$11,$12,$13,$14,$15,$16,$17
dc.b $18,$19,$1A,$1B,$1C,$1D,$1E,$1F
dc.b $20,$21,$22,$23,$24,$25,$26,$27
dc.b $28,$29,$2A,$2B,$2C,$2D,$2E,$2F
dc.b $30,$31,$32,$33,$34,$35,$36,$37
dc.b $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
dc.b $40,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4A,$4B,$4C,$4D,$4E,$4F
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5A,$5B,$5C,$5D,$5E,$5F
dc.b $60,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4A,$4B,$4C,$4D,$4E,$4F
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5A,$7B,$7C,$7D,$7E,$7F
dc.b $80,$81,$82,$83,$84,$85,$86,$87
dc.b $88,$89,$8A,$8B,$8C,$8D,$8E,$8F
dc.b $90,$91,$92,$93,$94,$95,$96,$97
dc.b $98,$99,$9A,$9B,$9C,$9D,$9E,$9F
dc.b $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7
dc.b $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF
dc.b $B0,$B1,$B2,$B3,$B4,$B5,$B6,$B7
dc.b $B8,$B9,$BA,$BB,$BC,$BD,$BE,$BF
dc.b $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
dc.b $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF
dc.b $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7
dc.b $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF
dc.b $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
dc.b $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF
dc.b $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7
dc.b $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF
ENDC
*- strings -------------------------------------------------------*
strings dc.w 0
Day1 dc.b 'Sonndich',0 ; Sunday
Day2 dc.b 'Meedich',0 ; Monday
Day3 dc.b 'Daischdich',0 ; Tuesday
Day4 dc.b 'Middwoch',0 ; Wednesday
Day5 dc.b 'Doorschdich',0 ; Thursday
Day6 dc.b 'Freidich',0 ; Friday
Day7 dc.b 'Samschdich',0 ; Saturday
AbDay1 dc.b 'Son',0 ; Sun
AbDay2 dc.b 'Mee',0 ; Mon
AbDay3 dc.b 'Dai',0 ; Tue
AbDay4 dc.b 'Mid',0 ; Wed
AbDay5 dc.b 'Doo',0 ; Thu
AbDay6 dc.b 'Fre',0 ; Fri
AbDay7 dc.b 'Sam',0 ; Sat
Mon1 dc.b 'Januar',0 ; January
Mon2 dc.b 'Februar',0 ; February
Mon3 dc.b 'März',0 ; March
Mon4 dc.b 'Abril',0 ; April
Mon5 dc.b 'Mai',0 ; May
Mon6 dc.b 'Juni',0 ; June
Mon7 dc.b 'Juli',0 ; July
Mon8 dc.b 'Auguschd',0 ; August
Mon9 dc.b 'Sebdember',0 ; September
Mon10 dc.b 'Ogdober',0 ; October
Mon11 dc.b 'November',0 ; November
Mon12 dc.b 'Dezember',0 ; December
AbMon1 dc.b 'Jan',0 ; Jan
AbMon2 dc.b 'Feb',0 ; Feb
AbMon3 dc.b 'Mär',0 ; Mar
AbMon4 dc.b 'Apr',0 ; Apr
AbMon5 dc.b 'Mai',0 ; May
AbMon6 dc.b 'Jun',0 ; Jun
AbMon7 dc.b 'Jul',0 ; Jul
AbMon8 dc.b 'Aug',0 ; Aug
AbMon9 dc.b 'Sep',0 ; Sep
AbMon10 dc.b 'Okt',0 ; Oct
AbMon11 dc.b 'Nov',0 ; Nov
AbMon12 dc.b 'Dez',0 ; Dec
YesStr dc.b 'Jo',0 ; Yes
NoStr dc.b 'Noi',0 ; No
AM_Str dc.b 'Morgends',0 ; AM
PM_Str dc.b 'Obends',0 ; PM
SoftHyphen dc.b '-',0
HardHyphen dc.b '-',0
OpenQuote dc.b '"',0
CloseQuote dc.b '"',0
YesterdayStr dc.b 'Geschdern',0 ; Yesterday
TodayStr dc.b 'Heit',0 ; Today
TomorrowStr dc.b 'Morga',0 ; Tomorrow
FutureStr dc.b 'Demnägschd',0 ; Future
even
*- FuncGetString --------------------------------------------------*
* Input:
* D0 - string number
* Output:
* D0 - string address or 0 on error
*------------------------------------------------------------------*
FuncGetString
cmp.l #MAXSTRMSG,d0 ; out of range?
bcc.s .noStr ; yes, fail
asl.w #2,d0 ; get longword offset
move.l strTab(pc,d0.w),d0 ; get string pointer
rts
.noStr moveq #0,d0
rts
*- strTab --------------------------------------------------------*
strTab dc.l strings
dc.l Day1
dc.l Day2
dc.l Day3
dc.l Day4
dc.l Day5
dc.l Day6
dc.l Day7
dc.l AbDay1
dc.l AbDay2
dc.l AbDay3
dc.l AbDay4
dc.l AbDay5
dc.l AbDay6
dc.l AbDay7
dc.l Mon1
dc.l Mon2
dc.l Mon3
dc.l Mon4
dc.l Mon5
dc.l Mon6
dc.l Mon7
dc.l Mon8
dc.l Mon9
dc.l Mon10
dc.l Mon11
dc.l Mon12
dc.l AbMon1
dc.l AbMon2
dc.l AbMon3
dc.l AbMon4
dc.l AbMon5
dc.l AbMon6
dc.l AbMon7
dc.l AbMon8
dc.l AbMon9
dc.l AbMon10
dc.l AbMon11
dc.l AbMon12
dc.l YesStr
dc.l NoStr
dc.l AM_Str
dc.l PM_Str
dc.l SoftHyphen
dc.l HardHyphen
dc.l OpenQuote
dc.l CloseQuote
dc.l YesterdayStr
dc.l TodayStr
dc.l TomorrowStr
dc.l FutureStr
End END