User Tag List

Страница 18 из 70 ПерваяПервая ... 141516171819202122 ... ПоследняяПоследняя
Показано с 171 по 180 из 699

Тема: SjASMPlus от z00m

  1. #171

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    I feel this is not truly responsibility of assembler
    у меня на макросах для sjasm написан chip8 компилятор
    он кидает кучу ошибок в процессе
    но на выходе код получается правильный
    и некоторые команды z80 там по моему вполне заменены командами chip8

    - - - Добавлено - - -

    поддерживаемые команды
    Код:
    	8080 like	z80 like
    0***	sys ***
    00C*	scdown *	scd *
    00E0	cls
    00EE	rts		ret		rst тк при попытке напечатать rts часто получается именно так
    00FB	scright		scr
    00FC	scleft		scl
    00FD	exit
    00FE	low
    00FF	high
    1***	jmp ***		jp ***
    2***	jsr ***		call ***
    3x**	skeq vx,**	se vx,**
    4x**	skne vx,**	sne vx,**
    5xy0	skeq vx,vy	se vx,vy
    6x**	mov vx,**	ld vx,**
    7x**	add vx,**
    8xy0	mov vx,vy	ld vx,vy
    8xy1	or vx,vy
    8xy2	and vx,vy
    8xy3	xor vx,vy
    8xy4	add vx,vy
    8xy5	sub vx,vy
    8x06	shr vx				+ 8xx6 mode
    8xy7	rsb vx,vy	subn vx,vy
    8x0E	shl vx				+ 8xxE mode
    9xy0	skne vx,vy	sne vx.vy
    A***	mvi ***
    B***	jmi ***
    Cx**	rand vx,**	rnd vx,**
    Dxy*	sprite vx,vy,*	drw vx,vy,*
    Dxy0	xsprite vx,vy
    Ex9E	skpr vx		skp vx
    ExA1	skup vx		skpn vx
    Fx07	gdelay vx
    Fx0A	key vx
    Fx15	sdelay vx
    Fx18	ssound vx
    Fx1E	adi vx
    Fx29	font vx
    Fx30	xfont vx
    Fx33	bcd vx
    Fx55	str v0-vx
    Fx65	ldr v0-vx

    Этот пользователь поблагодарил NEO SPECTRUMAN за это полезное сообщение:

    Ped7g(30.09.2019)

  2. #172

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    I think it would make some sense to collect these tricks/ideas/warnings about how to make your life easier while programming GB ROM into some kind of blog, or document, maybe even just `test/macro_examples` file?

    But I also want to avoid mentioning "GB" word or "N" word directly in sjasmplus git (also the reason of naming it "lr35902" everywhere, even if I can't remember that number and always have to check the other terminal with sjasmplus --help), so some external blog would be probably better place to describe all these intricacies, maybe even create the checksum macro, etc... show some ROM image build form scratch...

    (I'm not planning to get myself involved in this, my focus is ZX Next, so this is all open field for you guys, I will add more tests to verify the --lr35902 works correctly in sjasmplus, and that's my part "done", rest is on your ( = whoever wants to use sjasmplus for GB projects) shoulders. .... so these are like "advice how you can waste your spare time if you feel bored" )

  3. #173

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    NEO: most of the tests added, few bugs fixed (Z80 opcodes generated for invalid instructions) ...
    https://github.com/z00m128/sjasmplus.../tests/lr35902

    I think this is now very closed to "done" (I just need to add few more tests for Z80/Z80N instructions and some tests for CLI option/device, but with a bit of luck I managed to fix all bugs with this last commit.

    The LR35902_specifics_exercise.asm (and .lst) contains small showcase of how the sjasmplus features/syntax work also for LR35902 instructions and how the valid values are checked.

    Please review it all and if you spot something ridiculous or wrong, let me know, thank you.

  4. #174

    Регистрация
    22.05.2011
    Адрес
    г. Дзержинск, Украина
    Сообщений
    6,829
    Спасибо Благодарностей отдано 
    483
    Спасибо Благодарностей получено 
    663
    Поблагодарили
    513 сообщений
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    для лучшего понимания

    Код:
    var1        db      0x34
    var2        dw      0x5678
    var3        db      0xAB
    var4        dw      0xCDEF
    лучше бы сделать

    Код:
    var_34        db      0x34
    var_5678      dw      0x5678
    var_AB        db      0xAB
    var_CDEF      dw      0xCDEF



    Код:
            ; legit ones
                stop                ; implicit 0
                stop    0
                stop    0xE0

    а что за stop e0 ? о_О
    генерируещее 10 E0

    сейчас в одном описании попался просто вариант $10 для stop o_O

    у stop та же ошибка что и у halt ?

    где про это написано?

    в http://www.pastraiser.com/cpu/gamebo...y_opcodes.html тоже упоминается вариант 10
    Instruction STOP has according to manuals opcode 10 00 and thus is 2 bytes long. Anyhow it seems there is no reason for it so some assemblers code it simply as one byte instruction 10.
    - - - Добавлено - - -

    проверил
    как такое трактуется в IDA
    Код:
    		ld	a, b
    ; ---------------------------------------------------------------------------
    		db $10		;short stop
    ; ---------------------------------------------------------------------------
    		ld	a, c
    		ld	a, d
    		ld	a, b
    ; ---------------------------------------------------------------------------
    		stop		;stop
    ; ---------------------------------------------------------------------------
    		ld	a, c
    		ld	a, d
    		ld	a, b
    ; ---------------------------------------------------------------------------
    		db $10		;stop E0
    		ld	[$FF79], a
    ; ---------------------------------------------------------------------------
    		ld	a, d
    		ld	a, b
    ; ---------------------------------------------------------------------------
    		halt		;halt
    ; ---------------------------------------------------------------------------
    		ld	a, c
    		ld	a, d
    		ld	a, b
    ; ---------------------------------------------------------------------------
    		halt		;halt : nop
    		nop
    ; ---------------------------------------------------------------------------
    		ld	a, c
    		ld	a, d
    ida дает
    Command "MakeCode" failed




    и как в bgb

    Код:
    ROM1:4000 78               ld   a,b
    ROM1:4001 10 79            <corrupted stop>	;short stop
    ROM1:4003 7A               ld   a,d
    
    ROM1:4004 78               ld   a,b
    ROM1:4005 10 00            stop			;stop
    ROM1:4007 79               ld   a,c
    ROM1:4008 7A               ld   a,d
    
    ROM1:4009 78               ld   a,b
    ROM1:400A 10 E0            <corrupted stop>	;stop E0
    ROM1:400C 79               ld   a,c
    ROM1:400D 7A               ld   a,d
    
    ROM1:400E 78               ld   a,b
    ROM1:400F 76               halt 		;halt
    ROM1:4010 79               ld   a,c
    ROM1:4011 7A               ld   a,d
    
    ROM1:4012 78               ld   a,b
    ROM1:4013 76               halt 		;halt : nop
    ROM1:4014 00               nop  
    ROM1:4015 79               ld   a,c
    ROM1:4016 7A               ld   a,d
    Последний раз редактировалось NEO SPECTRUMAN; 30.09.2019 в 21:19.

  5. #175

    Регистрация
    02.05.2015
    Адрес
    г. Таллин, Эстония
    Сообщений
    1,691
    Спасибо Благодарностей отдано 
    302
    Спасибо Благодарностей получено 
    223
    Поблагодарили
    159 сообщений
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    IAnyway, this is something completely new in sjasmplus, to warn on instruction depending on the state from previous instruction.
    How you can find previous instruction, if HALT is reached after jump or call?
    Seems tracking previous instruction is only half of solution, and looks more like crutch.

  6. #176

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от NEO SPECTRUMAN Посмотреть сообщение
    а что за stop e0 ? о_О
    I think I have catched a glimpse of some note about GBC using stop + value as mechanism to modify some console HW settings, but I may be wrong (and I don't care). Either way, the `stop` is two byte instruction in every decent description I have seen, suggesting the second byte is zero, so that is what `stop` does, but it has this optional argument which can override the zero byte to anything you want. Maybe it's useless/wrong, but shouldn't cause any harm, as normal usage is `stop` without argument = that will produce implicit zero. There is no way to produce short stop in sjasmplus (except "db $10"). I think anyone of need of these unofficial things knows how to deal with it without direct support? I guess.

    .... and I pushed to github final batch of tests I did plan to add, for me this feature is done. Waiting for bug reports...


    Цитата Сообщение от Bedazzle Посмотреть сообщение
    How you can find previous instruction, if HALT is reached after jump or call?
    Seems tracking previous instruction is only half of solution, and looks more like crutch.
    It's the other way, when assembling current line, I need to know that the previous instruction was `halt` and if the current instruction is not `nop`, a warning can be shown. Jumps/calls don't matter at all, as halt can't jump, so the next instruction after it will be executed, either in regular way, or with instruction opcode repeated (hw glitch of GB consoles), depending on the state of the machine when halt was reached. So `nop` is kinda only safe opcode after `halt` to fight this glitch back, unless you know precisely what you are doing and actually you want to use that glitch for some planned behaviour.

    Anyway, from the assembling point of view, it's all about some internal "flag" being set by `halt` and staying active for one next instruction, which is trivial to add as some global variable, which usually trivially decays into weird bugs like forgetting to clear it in certain code paths, etc... So I'm not in hurry to add it, maybe I will figure out something more elegant and easier to maintain later. (or maybe somebody else will write some static-analyzer/lint for Z80 machine code )

  7. #177

    Регистрация
    02.05.2015
    Адрес
    г. Таллин, Эстония
    Сообщений
    1,691
    Спасибо Благодарностей отдано 
    302
    Спасибо Благодарностей получено 
    223
    Поблагодарили
    159 сообщений
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    It's the other way, when assembling current line, I need to know that the previous instruction was `halt` and if the current instruction is not `nop`, a warning can be shown.
    I mean it is not straightforward

    HALT
    DB 0

    ....

    DB 117+1
    NOP


    ....

    HALT
    AND A

  8. #178

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Bedazzle Посмотреть сообщение
    I mean it is not straightforward
    Exactly. ... from your examples the first and third should do warning and second not (even if that value is `halt`). But it can even more tricky.
    For example:
    Код:
        DUP 4
          nop : halt
        EDUP
        nop
    ... good luck with that if you are sitting early in the pipeline around substitutions and before macros are even processed...
    (not saying that sitting late in the pipeline where the bytes are emitted is better, pretty much same complexity, just completely different problems)

  9. #179

    Регистрация
    02.05.2015
    Адрес
    г. Таллин, Эстония
    Сообщений
    1,691
    Спасибо Благодарностей отдано 
    302
    Спасибо Благодарностей получено 
    223
    Поблагодарили
    159 сообщений
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    Exactly. ... from your examples the first and third should do warning and second not (even if that value is `halt`). But it can even more tricky.
    Код:
    IFDEF FREEZER
       HALT
    ENDIF
    
    NOP

  10. #180

    Регистрация
    10.05.2019
    Адрес
    Prague, Czech Republic
    Сообщений
    229
    Спасибо Благодарностей отдано 
    51
    Спасибо Благодарностей получено 
    103
    Поблагодарили
    77 сообщений
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Hey.. it just now occurred to me... GB is using banking to read all that ROM cartridge, right?
    any examples, how it is done, and if anything useful can be improved on sjasmplus side?
    Or is device like ZXSPECTRUM1024 + SAVEDEV large enough to build bigger ROM image easily and the 0x8000 slot sizes are native also to GB banking?

    I just added the "$$label" operator, it is returning label's page value, so now it is enough to do in source:
    Код:
        DEVICE ZXSPECTRUM1024 : SLOT 3
        ORG $c000, 4
    fn1:
    ; fn1page EQU $$   ;; not needed anymore
        nop : ...
    
    ; and the code which wants to know the page where the beginning of the code did land
    ; and set the bank, can use the $$ like this:
        ORG $8000
        ld a,$$fn1 + whatever_const   ; 4 + whatever_const
        out (c),a            ; switch bank
        call fn1              ; execute the code
    In ideal case this should help also with GB, so device with suitable slots/pages to define the page-of-label well may be needed. But I'm too lazy to read about GB specs, so if NEO or somebody else will post simple details here, what needs change, I will look into it.
    Последний раз редактировалось Ped7g; 02.10.2019 в 12:03. Причина: typo fixed

Страница 18 из 70 ПерваяПервая ... 141516171819202122 ... ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 2 (пользователей: 0 , гостей: 2)

Похожие темы

  1. SjASMPlus Z80 кросс ассемблер
    от Aprisobal в разделе Программирование
    Ответов: 1663
    Последнее: 19.06.2021, 01:36
  2. Исходники TR-DOS для SjASMPlus
    от Keeper в разделе Программирование
    Ответов: 20
    Последнее: 11.02.2011, 11:57
  3. Запуск STS из .sna, сгенерированного sjasmplus.
    от siril в разделе Программирование
    Ответов: 7
    Последнее: 11.10.2010, 21:33
  4. Breakpoints в связке Sjasmplus+UnrealSpeccy
    от Kurles в разделе Программирование
    Ответов: 19
    Последнее: 26.01.2009, 12:36
  5. Disturbed COverMAnia ( music disk with z00m music collection)
    от kyv в разделе Музыка
    Ответов: 10
    Последнее: 27.03.2008, 10:01

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •