Style Guide for Z80 Assembly Code

Pagina 3/5
1 | 2 | | 4 | 5

Van sd_snatcher

Prophet (3367)

afbeelding van sd_snatcher

10-09-2020, 23:38

Lower case, definitely! LOL!

Grauw wrote:

Are we talking about back in the 80s/90s or about now?

Well, assembly is pretty much a language of the past, isn't it? Wink

It's not only the labels, but all mnemonics were designed to fit into TABSTOP=8

(PS: Don't take any of my comments on this thread too seriously)

Van ToriHino

Hero (602)

afbeelding van ToriHino

11-09-2020, 00:12

As long as the tabs are in upper case i don't care Tongue

Van Grauw

Ascended (9395)

afbeelding van Grauw

11-09-2020, 00:15

Source files in UTF-8 or something else? Big smile

(This would actually be good feedback for Glass.)

Van Metalion

Paragon (1215)

afbeelding van Metalion

11-09-2020, 10:41

Grauw wrote:

Tabs for life!

santiontanon wrote:

oh, we are really going there aren't we? hahaha How about upper case vs lower case? Wink

If you guys have not seen it, you should really watch the "Silicon Valley" series.
https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)
I've seen all 6 seasons, and it's really a programmer/nerd/geek's delight ...
At some point, they do have this kind of debate.

;)

PS : the forum parser does NOT want to render correctly the url given for the series ...

Van pgimeno

Master (245)

afbeelding van pgimeno

11-09-2020, 12:08

It's not a valid URL actually. The parentheses need escaping.
https://en.wikipedia.org/wiki/Silicon_Valley_%28TV_series%29

Van Thom

Hero (655)

afbeelding van Thom

11-09-2020, 12:56

Too bad it's only on HBO?

About lower vs upper caps. I don't know. To me, lower caps are easier on the eye, I don't want source code shouting at me.
About tabs vs spaces: I used to favor tabs, but now I support #teamspace. The reason is pretty stupid though: one of the editors I use a lot is Geany. And geany shows tabs als an arrow, which leads to a pretty busy source code. Spaces are just tiny dots.

Van theNestruo

Master (226)

afbeelding van theNestruo

11-09-2020, 13:08

Thom wrote:

About lower vs upper caps. I don't know. To me, lower caps are easier on the eye, I don't want source code shouting at me.

I prefer lowercase too, but "wrong" fonts (those with too similar 1/l/I glyphs) may influence the decision.

Thom wrote:

About tabs vs spaces: I used to favor tabs, but now I support #teamspace. The reason is pretty stupid though: one of the editors I use a lot is Geany. And geany shows tabs als an arrow, which leads to a pretty busy source code. Spaces are just tiny dots.

I'm used to Eclipse, where you can change the visibility of whitespace depending on the charater and the position (e.g.: I can hide leading tabs and enclosed spaces... so "right" whitespace is not shown and, when I see a whitespace, it is usually "wrong": trailing spaces, enclosed tabs...).
Almost every other editor has this whitespace visibility setting less elaborated, and I miss the flexibility of Eclipse.

Van Grauw

Ascended (9395)

afbeelding van Grauw

11-09-2020, 13:54

VSCode has various options for showing whitespace markers, but the default setting nowadays is to only show them when you select text. I think that makes the perfect balance between noise-free source code reading, and awareness and visibility of white space (trailing, spaces/tabs, etc).

Eclipse doesn’t have that option but it is quite configurable, I used to have it configured to not show leading tabs but do show leading spaces, to always show enclosed tabs, and to always show trailing tabs & spaces. This made it highlight just those that I either wanted to avoid or at least be aware of.

Van Timmy

Expert (128)

afbeelding van Timmy

11-09-2020, 14:24

Something that's probably unrelated, but a few months ago I was trying to port a wyz_player to an old z80 assembler that can only handle official z80 opcodes (well, just not as advanced as some other assemblers).

Then I realised all that wyz_player codes were written in square brackets [] instead of regular brackets (), and I gave up. Big smile

Van theNestruo

Master (226)

afbeelding van theNestruo

11-09-2020, 15:06

Timmy wrote:

Then I realised all that wyz_player codes were written in square brackets [] instead of regular brackets (), and I gave up. Big smile

So the original author of wyz_player is also on the bracket gang... Cool (that's probably caused because it is intended for AsMSX).

With VSCode (or any editor that supports search/replace with regex) you can replace [] indirections with () indirections. Search for \[([^\]]+)\] and replace with ($1) .

Or just click here :) (not sure if it is the same version that intended to convert...)

Pagina 3/5
1 | 2 | | 4 | 5