Если что еще одна копия того сайта http://retro.hansotten.nl/lee-davison-web-site/
Вид для печати
Если что еще одна копия того сайта http://retro.hansotten.nl/lee-davison-web-site/
у дядьки генерация квадратов на мой взгляд сомнительная. Хотя.. кто знает? мне понадобилась таблица для знаковых и беззнаковых чисел.
Код:org $2000
start
ldy #1
ldx #0
sty de
dey
sty de+1
sty hl
sty hl+1
sqtab equ $1000
sq_lp
lda hl+1
sta sqtab+256,y
sta sqtab+256,x
lda hl
sta sqtab,y
sta sqtab,x
clc
adc de
sta hl
lda hl+1
adc de+1
sta hl+1
lda de
clc
adc #2
sta de
bcc no_inc_de
inc de+1
no_inc_de
dex
iny
cpy #129
bne sq_lp
;http://www.cpcwiki.eu/index.php/Programming:Precalculated_square
;INITSQ LD DE, 1 ;1st odd number
; LD HL, 0 ;HL = 1st square number
; LD B, H ;counter = 256
; LD IX, SQTAB ;startaddress of the square table
;SQLOOP LD (IX), L ;Lowbyte to table
; INC IX
; LD (IX), H ;Highbyte to table
; INC IX
; ADD HL, DE ;add odd number
; INC DE ;next odd number
; INC DE
; DJNZ SQLOOP ;256 times
; RET
jmp *
hl
dta 0,0
de
dta 0,0
run start
MADS у меня работает и с WDSN и с Notepad++.
Здесь сам MADS http://mads.atari8.info/
В дистрибутиве подробная справка, правда на инглише для версии 1.95 а свежая на польском. Но переводится вменяемо.
В комплекте есть куча примеров и либ, а так же в дистрибутиве есть мануал как прикрутить к Notepad++.
примеры MADS хороши, меня макросы убивают
Шынни, угу меня так же.
У JAC! в туторах есть наводки, попробую въехать...
ЗЫ. Я ошибаюсь или нет? Авторы MADS похоже фанаты паскаля, отсюда и закидоны с макросами...
Это макро команды MACRO COMMANDS
The purpose of macro commands is to save time when writing programs and to shorten listings. Macro commands replace commonly used groups of instructions.
MVA, MVX, MVY
The macro commands MVA, MVX, MVY transfer bytes using the A, X, or Y registers, respectively. OPT R+ can potentially reduce the code size from these macros by removing redundant instructions.
lda src -> mva src dst
sta dst ->
ldy $10,x -> mvy $10,x $a0,x
sty $a0,x ->
ldx #$10 -> mvx #$10 dst
stx dst ->
MWA, MWX, MWY
The macro commands MWA, MWX, MWY transfer words using the A, X, or Y registers, respectively. OPT R+ can potentially reduce the code size from these macros by removing redundant instructions.
ldx <adr -> mwx #adr dst
stx dst ->
ldx >adr ->
stx dst+1 ->
mwa #0 $80 -> lda #0 mwy #$3040 $80 -> ldy <$3040
-> sta $80 -> sty $80
-> sta $81 -> ldy >$3040
-> sty $81
mwa ($80),y $a000,x -> lda ($80),y
-> sta $a000,x
-> iny
-> lda ($80),y
-> sta $a001,x
- - - Добавлено - - -
Естественно, но я о другом - о форме записи макросов -
.macro SetColor val,reg
lda :val
sta :reg
.endm
И еще - в хелпе есть ошибки , так что читать , сверять английскую версию с польской и проверять по сырцам...
Если быстро набирать текст, то удобно, да. По мне xasm удобнее - понимает MADS, капризен к синтаксису и немало хороших фич.
Когда я начал писать 16К на Silly Venture, пришлось пересесть на xasm.
Насчет XASM vs MADS .
Кстати в поставке WUDSN есть и XASM и другие асмы .
Цитата:
DIFFERENCES AND SIMILARITIES BETWEEN MADS AND XASM
Similarities
the same syntax
the same exit codes
the same macro commands
Differences and new behaviors
small additions to ORG, e.g.. 'ORG [[expression]]adres[,adres2]'
XASM does not like whitespace, MADS tolerates and accepts it in logical/arithmetic expressions and static/variable definitions
MADS allows expressions to be grouped with (), [], XASM only within []
MADS provides static and variable definitions of local, global, and temporary scope, XASM only global
MADS does not accept ORG a:adres or ORG f:adres
MADS encodes real numbers using the directive .FL .FL real, XASM by pseudo-command DTA R DTA R(real)
MADS has expanded support in the pseudo-command INS
MADS does not accept the addressing form 'lda (203),0'
MADS allows writing programs for SpartaDOS X
MADS permits writing relocatable code in a custom format
when encoding the value of a character, i.e.
lda #' '
lda #" "
MADS distinguishes between single quotes (ATASCII coding) and double quotes (INTERNAL coding), whereas XASM treats both forms the same (ATASCII coding). Of course, the quote types are treated the same in DTA by MADS.
in indexed modes, a '+' or '-' sign increments or decrements the index register, e.g.
lda $2000,x+ -> lda $2000,x
inx
but if the '+' or '-' sign is used with a value, it change the value of the main operand instead (this only works with absolute indexed addressing):
lda $2000,x+2 -> lda $2002,x