User Tag List

Страница 50 из 70 ПерваяПервая ... 464748495051525354 ... ПоследняяПоследняя
Показано с 491 по 500 из 699

Тема: SjASMPlus от z00m

  1. #491

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

    По умолчанию

    Цитата Сообщение от Dart Alver Посмотреть сообщение
    Понятно... Новая версия - новые забавы
    yeah... this is how it looks on my machine
    Нажмите на изображение для увеличения. 

Название:	sj_color.jpg 
Просмотров:	1518 
Размер:	21.5 Кб 
ID:	76045

  2. #492

    Регистрация
    18.07.2021
    Адрес
    г. Хмельницкий, Украина
    Сообщений
    105
    Спасибо Благодарностей отдано 
    12
    Спасибо Благодарностей получено 
    33
    Поблагодарили
    25 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Ped7g, is it possible to save some area of RAM into the file? Looks like SAVEBIN works only at compile time, but I need to do this in runtime, i.e. load some block of code via INCBIN, do some conversions with it and save to the file? Obviously, it is not assembler's job, but who knows...

    Something like

    Код:
    ld hl, #E000
    xor a
    ld (hl), a
    inc a
    ld (hl), a
    SAVEBIN "file",#E000,#1
    and I need to get in the file "file" value of 1, not 0.

    ofc, I can save .sna, open it then with emulator, and save the block I need with TR-DOS, but it is not the straightforward way.

    upd
    ok, nevermind.
    "-ms address size filename": Saves a memory dump to a file. The file is saved to the temp directory.
    It is a command in debug console of DeZog extension for VSCode.

    But thanks in any case.
    Последний раз редактировалось 0xDEAD; 04.09.2021 в 14:18.

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

    Ped7g(06.09.2021)

  3. #493

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

    По умолчанию

    at runtime sjasmplus has no control over anything, it did already produce your machine code and exit, and that's all.

    You could produce your own macros for common tasks under your OS, like TR-DOS calls, etc.. but that differs from every target platform (ZX/NextZXOS/TR-DOS/esxdos/MSX/...) and it all could be done in the form of Z80 source defining some macros or subroutines.

    If the DeZog debugger command is enough for you, then even better.

  4. #494

    Регистрация
    18.07.2021
    Адрес
    г. Хмельницкий, Украина
    Сообщений
    105
    Спасибо Благодарностей отдано 
    12
    Спасибо Благодарностей получено 
    33
    Поблагодарили
    25 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Ped7g, One word about ABYTE(C|Z) pseudo-op.
    Suddenly, if <bytes> argument enclosed in double quotes, it means in 99,99999% (if not 100%) just text, plain text. So, if I want to include in text some control characters, it works ok (mgs02). But, if I add an <offset> to ABYTE(C|Z), the control character gets same offset as text string (mgs01).
    Why is it important (at least, for me)?
    Imagine that we define some text string with ABYTEZ (wow) and print it out. As is known, ASCII codes in ZX font starts from 32d (space). So, if I want to calculate an 1st address of symbol's byte in font file, I need to subtract 32 from ASCII code of symbol being printed, then add this value to the start address of the font.
    It can be done in two ways:
    something like
    Код:
    ld a, (msg01)
    sub 32
    add a, l
    ld l, a
    jr nc, .skip
    inc h
    .skip
    and this takes some CPU cycles and memory

    or by defining an offset like this:
    msg0 abytez -32 "01234567"
    But abytez with offset breaks control codes.

    So, I suggest to skip processing offset (only for double quoted content) for escape sequences (maybe except \\ one) in ABYTE(C|Z) pseudo-op.



    p.s.
    Don't tell me about LUA :-)
    I think, LUA-script for EACH text string is an overhead, overkill and over-whatever-else in this simple case.
    Последний раз редактировалось 0xDEAD; 08.09.2021 в 23:26.

  5. #495

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

    По умолчанию

    Цитата Сообщение от 0xDEAD Посмотреть сообщение
    So, I suggest to skip processing offset (only for double quoted content) for escape sequences (maybe except \\ one) in ABYTE(C|Z) pseudo-op.
    I'm afraid that would cause too much confusion with other users of previous versions.

    I guess you can eventually patch your own sjasmplus to do this, or I could maybe add something like this under some extra option.

    But I'm confused by your example reason:

    Цитата Сообщение от 0xDEAD Посмотреть сообщение
    So, if I want to calculate an 1st address of symbol's byte in font file, I need to subtract 32 from ASCII code of symbol being printed, then add this value to the start address of the font.
    That's usually not done this way, but you instead have the font address already pointing to virtual char zero, ie. like ZX ROM has font address $3C00 (the sysvar CHARS at $5C36), and the actual data starts at $3D00 with space char, because 32 * 8 = 256 and $3C00 + 256 is $3D00

    Similarly if you are fetching something from byte array for indices 4..7, you don't start with `ld hl,array` and do the full `array+index-4` math, but you start with `ld hl,array-4` already, adding only the index to it.

    Maybe check first if you can simplify your code?

    If you want to try your idea by patching sjasmplus, then in reader.cpp in `template <class strT> int GetCharConstAsString(char* & p, strT e[], int & ei, int max_ei, int add) {` (line 623 in v1.18.3 source) modify this part:
    Код:
    	while (ei < max_ei && (quotes ? GetCharConstInDoubleQuotes(p, val) : GetCharConstInApostrophes(p, val))) {
    		e[ei++] = (val + add) & 255;
    	}
    to something like this I guess:
    Код:
    	while (ei < max_ei && (quotes ? GetCharConstInDoubleQuotes(p, val) : GetCharConstInApostrophes(p, val))) {
    		const int ascii_add = (' ' <= val && val < 0x80) ? add : 0;		// use "add" value only for ASCII chars
    		e[ei++] = (val + ascii_add) & 255;
    	}
    (but using patched version of sjasmplus will probably complicate things later, so I would first check if you can avoid it by some simple way)

    (edit: no lua suggested, as you requested, instead we landed in the land of C++ )

    - - - Updated - - -

    actually, my confusion just adds up... imagine this:
    Код:
      ABYTEZ -32 "*\n"
    The current sjasmplus will produce bytes: 0A EA 00

    If I would add your idea to the sjasmplus, the produced bytes would be: 0A 0A 00

    How do you plan in your code to know which 0A is the newline and which is the asterisk character? (and similar collisions for other control codes).

    I'm afraid your proposal is too complicated and fragile for general-purpose directive like ABYTE, not planning to add it, sorry.

  6. #496

    Регистрация
    18.07.2021
    Адрес
    г. Хмельницкий, Украина
    Сообщений
    105
    Спасибо Благодарностей отдано 
    12
    Спасибо Благодарностей получено 
    33
    Поблагодарили
    25 сообщений
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    That's usually not done this way, but you instead have the font address already pointing to virtual char zero, ie. like ZX ROM has font address $3C00 (the sysvar CHARS at $5C36), and the actual data starts at $3D00 with space char, because 32 * 8 = 256 and $3C00 + 256 is $3D00
    I know about this. But imagine a KOI-8 font, containing english and russian characters, where, for example, char "D" has code 65 and corresponding to it russian char "Д" has code 132?
    Russian-speaking progammers often use transliteration from english in their code, because KOI8, CP866 and such not supported by software or/and hardware e.g., if you actually need to print string "Привет, как дела", you would define string "Privet, kak dela", and print it, using font, where code "P" corresponds to image of char "П", and so on - for readability.
    Код:
    lat_string abyte -32 "Hello\n how are you?"
    rus_string abyte 32 "<what should I write here to keep \n value and get readable string?>"
    Цитата Сообщение от Ped7g Посмотреть сообщение
    The current sjasmplus will produce bytes: 0A EA 00
    If I would add your idea to the sjasmplus, the produced bytes would be: 0A 0A 00
    How do you plan in your code to know which 0A is the newline and which is the asterisk character? (and similar collisions for other control codes).
    The initial idea was to reach string behavior like in Java/C++/C#. But Spectrum is not PC, and assembler is not Java, everyone has their own print, draw, plot, beep... routines.
    Последний раз редактировалось 0xDEAD; 09.09.2021 в 13:14.

  7. #496
    С любовью к вам, Yandex.Direct
    Размещение рекламы на форуме способствует его дальнейшему развитию

  8. #497

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

    По умолчанию

    The sjasmplus does process source files as 8bit extended ASCII (except when you use `--dos866` option), so you can put in quotes anything except 0, 10 and 13. (those need to be replaced by \0,\n,\r.
    So you can put the 132 for Д directly into string. The question is, how to edit such file conveniently, if you are using some common encoding like KOI-8 and your text editor understands different encodings, you can use it directly and write `DB "новые\nзабавы"`

    Example from listing file (I did edit source in Kate switching to KOI8-R encoding):
    Код:
     22   8284 CE CF D7 D9          DZ      "новые\nзабавы"
     22   8288 C5 0A DA C1
     22   828C C2 C1 D7 D9
     22   8290 00
     23   8291
    If you insist on using ABYTE with some +- offset, you also do it in a bit more-typing way: ABYTEZ -32 "Ahoy*",10+32,"world" adjusting control codes by +32
    This still of course doesn't solve the collisions:
    Код:
     23   8291 21 48 4F 59          ABYTEZ -32 "Ahoy*",10+32,"world"
     23   8295 0A 0A 57 4F         ; notice 2x 0A here, one is asterisk, other is "control code" 10+32
     23   8299 52 4C 44 00
    Or you can abuse it the other way, just checking in char table what is the control code with offset, and using '*' instead of \n in text to get value 10 after -32.

    If your print routine is aware of the offset used to process the text, like -32, it could also check for modified control codes, ie. looking for $EA instead of $0A, which is probably the more correct way, as it does resolve the control-codes value collisions with offset characters.

    If you have custom encoding, then it may be difficult to edit the file in text editor (I guess if I would define my own Locale in linux, the Kate editor would be maybe able to use it for editing, but I'm not sure, and I have no idea how much work it is). Then you can hypothetically have full 0..255 encoding exactly as you want it, including both English and Cyrillic characters in the font, or special symbols, etc... while being able to edit it conveniently in text form in some regular text editor.

    But with some standard like KOI-8 and similar, you can mostly avoid these extra features by editing the text directly in target encoding.
    Последний раз редактировалось Ped7g; 09.09.2021 в 12:50.

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

    0xDEAD(09.09.2021)

  9. #498

    Регистрация
    01.03.2005
    Адрес
    Samara
    Сообщений
    4,866
    Спасибо Благодарностей отдано 
    328
    Спасибо Благодарностей получено 
    310
    Поблагодарили
    234 сообщений
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Ped7g, hello
    i have little problem

    i make program and it will work from #0000 to #ffff
    and labellist not created correctly

    what can i do?
    С уважением,
    Jerri / Red Triangle.

  10. #499

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

    По умолчанию

    Цитата Сообщение от jerri Посмотреть сообщение
    i make program and it will work from #0000 to #ffff
    and labellist not created correctly

    what can i do?
    Sorry, but I don't understand what is the issue. Can you post some example?

    Do you have issue with code starting at #0000? You can use ORG to change current address of assembling.

  11. #500

    Регистрация
    01.03.2005
    Адрес
    Samara
    Сообщений
    4,866
    Спасибо Благодарностей отдано 
    328
    Спасибо Благодарностей получено 
    310
    Поблагодарили
    234 сообщений
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    Цитата Сообщение от Ped7g Посмотреть сообщение
    Sorry, but I don't understand what is the issue. Can you post some example?

    Do you have issue with code starting at #0000? You can use ORG to change current address of assembling.
    ok.

    i compile this code.___stoneage.zip

    labelslist "D:\_work\dropbox\_sources\___stoneage\user.l"
    Цитата Сообщение от user.l
    05:00AF T0XOffsL
    05:01AF T0XOffsH
    05:02AF T0YOffsL
    05:03AF T0YOffsH
    05:04AF T1XOffsL
    05:05AF T1XOffsH
    05:06AF T1YOffsL
    05:07AF T1YOffsH
    02:0000 stek
    05:3FF1 starter

    there is more labels but i see only this
    С уважением,
    Jerri / Red Triangle.

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

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

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

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

Похожие темы

  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

Ваши права

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