Apps/tube: Improved code style and readability #134

Merged
mxlgv merged 2 commits from fixed-tube-demo-codestyle into main 2025-03-12 09:37:24 +01:00
Owner
No description provided.
mxlgv added 2 commits 2025-03-12 00:53:45 +01:00
The trunk directory is no longer required. This is a rudiment of SVN
Apps/tube: Improved code style and readability
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 34s
Build system / Build (pull_request) Successful in 5m20s
c77ec910a2
- Magic numbers are replaced with constants;
- Added copyrights and source to the original;
- Removed unnecessary *.bat files.

Co-authored-by: Max Logaev <maxlogaev@proton.me>
mxlgv requested review from IgorA 2025-03-12 00:54:10 +01:00
mxlgv reviewed 2025-03-12 01:03:23 +01:00
@@ -0,0 +88,4 @@
loop ROTATE
fld st1
db 0xdc,0xc8 ;fmul st0,st ?
Author
Owner

Is this still relevant?

Is this still relevant?
Author
Owner

fasm generates a different D8 C8 opcode. But in fact, if i = 0, then it is the same thing. It's just that fasm and nasm generate different instructions:

FMUL ST(0), ST(i)	D8 C8+i		Multiply ST(0) by ST(i) and store result in ST(0).
FMUL ST(i), ST(0)	DC C8+i		Multiply ST(i) by ST(0) and store result in ST(i).

See: https://shell-storm.org/x86doc/

fasm generates a different `D8 C8` opcode. But in fact, if i = 0, then it is the same thing. It's just that fasm and nasm generate different instructions: ``` FMUL ST(0), ST(i) D8 C8+i Multiply ST(0) by ST(i) and store result in ST(0). FMUL ST(i), ST(0) DC C8+i Multiply ST(i) by ST(0) and store result in ST(i). ``` See: https://shell-storm.org/x86doc/
@@ -0,0 +90,4 @@
fld st1
db 0xdc,0xc8 ;fmul st0,st ?
fld st1
db 0xdc,0xc8 ;fmul st0,st ?
Author
Owner

Is this still relevant?

Is this still relevant?
Author
Owner
https://git.kolibrios.org/KolibriOS/kolibrios/pulls/134#issuecomment-1185
@@ -0,0 +118,4 @@
mov al,-48
STORE_1:
; add al,[ebx+esi+0x80000]
Author
Owner

Is this really necessary?

Is this really necessary?
Author
Owner
https://git.kolibrios.org/KolibriOS/kolibrios/pulls/134#issuecomment-1185
Member

Это был код, который возможно включал в программе какой-либо режим работы. Оставил на всякий случай, может кто-нибудь поймет что оно раньше делало.

Это был код, который возможно включал в программе какой-либо режим работы. Оставил на всякий случай, может кто-нибудь поймет что оно раньше делало.
mxlgv marked this conversation as resolved
@@ -0,0 +183,4 @@
ret
align 4
db 41,0,0xC3,0x3C
Author
Owner

@IgorA What is this for?

@IgorA What is this for?
Member

Судя по коду это 4-х байтное число с плавающей точкой, потому как оно грузится в fpu инструкции. Но из это-го же места в другом месте кода грузится также 2 байта. Потому однозначно не понятно как его сделать или перевести во float или оставить как 4 отдельных байта.

Судя по коду это 4-х байтное число с плавающей точкой, потому как оно грузится в fpu инструкции. Но из это-го же места в другом месте кода грузится также 2 байта. Потому однозначно не понятно как его сделать или перевести во float или оставить как 4 отдельных байта.
Author
Owner

It's clear. Thank you

It's clear. Thank you
mxlgv marked this conversation as resolved
Author
Owner

Add Copyright (C) 2001 Miloš Bazelides <baze@stonline.sk>

Add `Copyright (C) 2001 Miloš Bazelides <baze@stonline.sk>`
mxlgv force-pushed fixed-tube-demo-codestyle from c77ec910a2 to 61277f8822 2025-03-12 09:04:43 +01:00 Compare
IgorA approved these changes 2025-03-12 09:31:39 +01:00
mxlgv merged commit 61277f8822 into main 2025-03-12 09:37:24 +01:00
mxlgv deleted branch fixed-tube-demo-codestyle 2025-03-12 09:37:30 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#134
No description provided.