Live data from Hacker News

Paint16b: A 16 byte paint program written in 12 lines

sizecoding.org

11–20 of 70 posts

Re: Paint16b: A 16 byte paint program written in 12 lines

#11
post #9
post #4

Earlier quoted context omitted.

Is assembly not common knowledge anymore?

In the parents defense 'assembly' isn't one thing. Every assembler has a different syntax, as does every chip family. The parent might be a master of 6502 ASM. And as that XKCD comic says. Everyone has to learn even the most obvious thing for the first time at some point.

Hm... If you know one assembly you can easily recognize when it is assembly, even if you don't know the specific architecture.

Re: Paint16b: A 16 byte paint program written in 12 lines

#13
post #9
post #4

Earlier quoted context omitted.

Is assembly not common knowledge anymore?

In the parents defense 'assembly' isn't one thing. Every assembler has a different syntax, as does every chip family. The parent might be a master of 6502 ASM. And as that XKCD comic says. Everyone has to learn even the most obvious thing for the first time at some point.

https://xkcd.com/1053/

Re: Paint16b: A 16 byte paint program written in 12 lines

#14

> assume ah=0; assume bx=0 Hmm. So the second time this program is run, it will fail?

No, AFAIK MS-DOS always initialises it to zero before starting the program. I'm trying to find a better reference, but I think this[0] effectively explains what state the registers are in on entry to your program.

Edit: I take that back. According to [1]:

  .COM-format executables begin running with the following register values:
  AL = 00h if first FCB has valid drive letter, FFh if not
  AH = 00h if second FCB has valid drive letter, FFh if not

[0] https://thestarman.pcministry.com/asm/debug/debug.htm#INIT

[1] http://www.delorie.com/djgpp/doc/rbinter/id/51/29.html

Re: Paint16b: A 16 byte paint program written in 12 lines

#15
post #9
post #4

Earlier quoted context omitted.

Is assembly not common knowledge anymore?

In the parents defense 'assembly' isn't one thing. Every assembler has a different syntax, as does every chip family. The parent might be a master of 6502 ASM. And as that XKCD comic says. Everyone has to learn even the most obvious thing for the first time at some point.

I admit my experience is limited, but there are few things that should immediately identify some code as assembly to someone with previous experience, regardless of the platform, such as the prevalence of the "mov" command, a "jump" command or the use of registers, using memory addresses as parameters, accssing stack using "push" and "pop" commands.

Registers might have different names depending on the platform, actual command names may vary, but I would be surprised to see non-obscure platforms for which the pattern above is not valid.

Re: Paint16b: A 16 byte paint program written in 12 lines

#18
post #9

Earlier quoted context omitted.

In the parents defense 'assembly' isn't one thing. Every assembler has a different syntax, as does every chip family. The parent might be a master of 6502 ASM. And as that XKCD comic says. Everyone has to learn even the most obvious thing for the first time at some point.

https://xkcd.com/1053/

This applies to general public but someone with Freelance Web developer based in Amsterdam. Mostly Node and React. in their bio should probably know what Assembly is...

Re: Paint16b: A 16 byte paint program written in 12 lines

#19
post #2

Be helpful if the page mentioned what language the program was written in.

16 bit x86 assembly. It will run on DOS with a VESA framebuffer and mouse driver. Dosbox with it's default config should work fine.

Nitpicking, but this is not a VESA mode, it is plain VGA mode 12h (640x480x16).
Post reply on HN