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

РосСценНадзор рекомендует
РосСценНадзор рекомендует
РосСценНадзор рекомендует
Title: РосСценНадзор рекомендует
Author: nodeus
Format: Standard 6912
Palette: sRGB
Party: DiHalt 2022 (1, Realtime graphics)
Year: 2022
Original filename: РосСценНадзор рекомендует.scr
Download 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.scrOriginal file
DownloadDownload for PC
DownloadDownload for PC (2X)
DownloadDownload for printing (A4 300dpi)
Tags: Black&white, Chip, Eye, Fist, Humor, Magnifying glass, Text
Rating:
4.29
Views: 37
Added by: nodeus, 09.01.2022 14:10
Apass19.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...

VBI20.01.2022 01:01
pop hl, dude :))
Apass07.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...

Leave a comment

Please perform a quick registration before leaving a comment

Votes history

Nickname Votes Date
Beaver527.02.2022 01:11
VBI520.01.2022 01:01
tiboh419.01.2022 18:45
scalesmann418.01.2022 18:09
Dimidrol416.01.2022 10:01
aGGreSSor509.01.2022 22:51
creator509.01.2022 20:42
pixelrat509.01.2022 20:23
4ept509.01.2022 18:14
Grongy509.01.2022 15:14
Art-top509.01.2022 14:45

Picture views for last 90 days.