РосСценНадзор рекомендует

РосСценНадзор рекомендует
РосСценНадзор рекомендует
РосСценНадзор рекомендует
Название: РосСценНадзор рекомендует
Автор: nodeus
Формат: Стандартный 6912
Палитра: sRGB
Пати: DiHalt 2022 (1, Realtime графика)
Год: 2022
Имя файла при закачке: РосСценНадзор рекомендует.scr
Скачать nodeus+-+%D0%A0%D0%BE%D1%81%D0%A1%D1%86%D0%B5%D0%BD%D0%9D%D0%B0%D0%B4%D0%B7%D0%BE%D1%80+%D1%80%D0%B5%D0%BA%D0%BE%D0%BC%D0%B5%D0%BD%D0%B4%D1%83%D0%B5%D1%82+%282022%29+%28DiHalt+2022%2C+1%29.scrОригинальный файл
СкачатьСкачать для PC 2X 3X 4X
СкачатьСкачать для печати (A4 300dpi)
Теги: Глаз, Кулак, Лупа, Текст, Черно-белый, Чип, Юмор
Рейтинг:
4.26
Просмотры: 117
Добавил: nodeus, 09.01.2022 14:10
Apass 19.01.2022 12:18
The image is very well done, however I have a gripe with the code snippet :P.
<joke>
I see 2 possibilities - 1) the code performs what it was intended to do but then is inefficient or 2) the code has a bug, and could be re-written in a simpler fashion.
First - the code copies in RAM at consecutive addresses the value of the accumulator, however, the accumulator is copied from the same memory location as DE is not incremented.
So the code can be simplified as:
PUSH HL
LD B, 4
LD DE, CODE
LD HL, #FE00
LD A,(DE)
LOAD LD (HL), A
INC HL
DJNZ LOAD
Note the position of the LOAD label. The only thing that this code does extra is wasting some time (7T states which is not easily replaced by NOPs)

Second - the code forgot to increment DE:
PUSH HL 11T states
LD B, 4 7T states
LD DE, CODE 10T states
LD HL, #FE00 10T states
LOAD LD A,(DE) 7T states
LD (HL), A 7T states
INC HL 6T states
INC DE 6T states
DJNZ LOAD 13/8T states
In this case, the code execution lasts 11 + 7 + 10 + 10 + 4 x (7 + 7 + 6 + 6) + 3 x 13 + 8 = 189T states.
If the code is re-written as:
PUSH HL 11T states
LD BC, 4 10T states
LD DE, #FE00 10T states
LD HL, CODE 10T states
LDIR 21/16T states
In this case, the code execution lasts 11 + 10 + 10 + 10 + 3 x 21 + 16 = 120T States
Or even quicker (with the observation that BC pair is not preserved)
PUSH HL 11T states
LD DE, #FE00 10T states
LD HL, CODE 10T states
LDI 16T states
LDI 16T states
LDI 16T states
LDI 16T states
This lasts 11 + 10 + 10 + 4 x 16 = 95T states (half of the initial variant)
</joke>

Finally, given the code snippet, I don't understand why the Z80 is dizzy?
If the code would have ended with:
DI
HALT
... On a Speccy... that would indeed make the CPU dizzy.
And it would have been quite a pun for the demoparty...

VBI 20.01.2022 01:01
pop hl, dude :))
Apass 07.02.2022 22:32
ORG #FFEF
PUSH HL
LD BC, #BFFA
LD HL, #4000
LD DE, #4001
LD (HL), #FF
LDIR
DI
HALT
POP HL

There, I fixed it!
I popped HL... to no avail...

Добавить комментарий

Пожалуйста, пройдите быструю регистрацию перед оставлением комментариев

История голосования

Никнейм Голоса Дата
creator 5 25.03.2024 05:49
moroz1999 4 12.01.2023 22:55
: AL/M ; 4 22.06.2022 00:04
Beaver 5 27.02.2022 01:11
VBI 5 20.01.2022 01:01
tiboh 4 19.01.2022 18:45
scalesmann 4 18.01.2022 18:09
Dimidrol 4 16.01.2022 10:01
aGGreSSor 5 09.01.2022 22:51
pixelrat 5 09.01.2022 20:23
gr8b/crs 5 09.01.2022 18:14
Grongy 5 09.01.2022 15:14
Art-top 5 09.01.2022 14:45