Message from @DanielKO

Discord ID: 429468458787274763


2018-03-31 01:46:39 UTC  

two can play it that way nigger

2018-03-31 01:49:19 UTC  
2018-03-31 02:25:47 UTC  

``bl printf /* calls printf */`` comments could use more redundancy

2018-03-31 02:27:54 UTC  

I guess it's useful for people not familiar with the mnemonics.

2018-03-31 02:28:13 UTC  

But then, `cmp r0, r1 /* compare r0 and r1 */` ? That's just retarded.

2018-03-31 02:28:23 UTC  

Gotta comment every line otherwise TA's give me shit

2018-03-31 02:29:33 UTC  

they should be more worried the students know what their code means

2018-03-31 02:30:01 UTC  

Back when I did assembly homework, I had to normalize a single-precision floating point number on a toy computer, that had only 256 bytes of RAM. And we had to write our own assembler.

2018-03-31 02:30:19 UTC  

i'm learning 68k but im gonna learn ARM after that

2018-03-31 02:30:26 UTC  

And whoever used the least instructions got bragging rights.

2018-03-31 02:30:37 UTC  

which computer

2018-03-31 02:31:32 UTC  

Oh, one that my professors used, I think it was created by a student a few years prior. Don't even remember the name.

2018-03-31 02:32:01 UTC  

It was your typical two operand instructions, 4-bit instructions.

2018-03-31 02:32:03 UTC  

interesting strategy. too obscure to cheat?

2018-03-31 02:32:34 UTC  

I guess so.

2018-03-31 02:32:48 UTC  

can i do your same assignment on 68k?

2018-03-31 02:33:17 UTC  

I don't see why not.

2018-03-31 02:33:29 UTC  

will it be easier then?

2018-03-31 02:33:41 UTC  

Probably.

2018-03-31 02:34:02 UTC  

I got bragging rights, by the way. Got my program to be even shorter than the professor's and the TAs' programs.

2018-03-31 02:34:19 UTC  

By using the instructions themselves as constants.

2018-03-31 02:34:48 UTC  

About 20% of the class couldn't make it fit in the 256 bytes.

2018-03-31 02:35:41 UTC  

what book did they give you for assembly

2018-03-31 02:35:45 UTC  

assembly is cancer

2018-03-31 02:35:58 UTC  

^you probly like java

2018-03-31 02:36:05 UTC  

^likes js

2018-03-31 02:36:13 UTC  

Another we had to do was long division. Actually, now that I'm thinking about it, the 4-bit instructions one was to program long division. The architecture didn't have division. The normalization one was on an 8-bit instructions architecture. Same 256 bytes limit for both.

2018-03-31 02:37:10 UTC  

well you've already said assembly is cancer twice. yet your computer needs it to run, js or no?

2018-03-31 02:38:22 UTC  

We didn't get any book, the course was on computer architectures. We went through the design of various didactic architectures, then at the end some MIPS and IA-32.

2018-03-31 02:41:50 UTC  

if i wanna play with ARM i should buy an rPi??

2018-03-31 02:42:02 UTC  

There are plenty of ARM devices.

2018-03-31 02:42:39 UTC  

yeah but its mainstream, deployable, versatile, so it's a good starting point?

2018-03-31 02:42:44 UTC  

yee

2018-03-31 02:42:47 UTC  

By all means, learn some assembly, it'll do you some good. But you don't really write programs in assembly; at least not if you want to finish coding it any time soon.

2018-03-31 02:43:04 UTC  

Mainstream? Go for x86-64.

2018-03-31 02:43:50 UTC  

You should know what compiled code looks like, specially if you want to have any hope of debugging code properly.

2018-03-31 02:44:11 UTC  

Say, what a function call looks like.

2018-03-31 02:44:29 UTC  

What an array access looks like.

2018-03-31 02:44:36 UTC  

What a C string operation looks like.

2018-03-31 02:44:49 UTC  

What an `if` or a `for` look like.

2018-03-31 02:46:16 UTC  

But you don't really write any significant code in assembly. We have compilers for that; at which point the architecture is irrelevant - as long as the language is supported by the hardware vendor.