Conversation
vibe coding the shit out of this thing
2
4
3
@sun Claude Tuah, Vibe on Dat Thang
1
3
1
@sun gpt4 still can't generate working armv4t assembly code to any meaningful capacity. it keeps screwing up memory regions, uses the wrong instruction set, or halucinates instructions and macros that don't exist. did you try any assembly code generation in other models?
3
0
0
@lucy @sun what are your constraints like?
1
0
0
@lucy Claude in Cursor wrote me an entire crt0.S and some minor asm in other places, also it was fairly intelligent about handling program segments. not perfect but I was able to bang out working GBA code
2
1
3
@arcana @sun it should work on a gba, it's armv4t code and valid code in gnu assembler? or wdym
1
0
0
@sun @lucy I imagine cursor automates a bunch of the chain of thought and constraining stuff
1
0
1
@lucy @sun and did you specify these in your prompt?
1
0
0
@lucy @sun can I see what your prompts look like?
1
0
0
@arcana @lucy I asked it to do special stuff and it handled it. I mean I know under the covers it's not "thinking" but the results were okay.

I did have some cases where it hallucinated instructions though
0
0
2
@arcana @sun no i deleted it
1
0
0

@lucy @sun LLMs just aren’t capable of that. need to keep track of differences between related but incompatible architectures, register state, pipeline state (instruction prefetch, hazards) which varies for each processor and so on.

0
0
1
@lucy @sun it would be useful to see, there’s definitely an art to this kind of thing imo, especially if doing it raw rather than through some kind of tool or IDE
1
0
1
@lucy another cool thing: it's definitely aware of GBA architecture because it knows what to put where to make boot work since GBA has very specific startup needs.
1
0
1
@sun i asked gpt4 about memory regions and where to put what and it gaves me a completely wrong description, not just wrong but also not even consistent within itself
2
0
1
@lucy @sun also try o3 or o1, but again, make sure you’re very clear on the constraints, requirements, and directions. Feed in documentation and existing code into the context window.
0
0
0

@lucy @sun i’d expect it to be as good at solving programming problems as with cooking recipes

1
0
1
@lucy @sun I really want to see what your prompts look like that you’re getting these results
1
0
0

@lucy @sun you can’t do this without actual logical reasoning. which these models have been proven not to be capable of for obvious reasons.

you can only get it to regurgitate boilerplate, essentially.

0
0
1

@arcana @sun alright, i did something:

i first asked: “armv4t does not have the blx instructin found in later architectures. build a gnu assembler compatible macro to emulate the behaviour as close as possible, ignore the “exchange” aspect if necessary.” the last “ignore the exchange aspect” is very important because it leads to a very easy solution.

it replied “The BLX instruction (Branch with Link and Exchange) in later ARM architectures performs a branch while storing the return address in LR (link register), with optional instruction set switching. Since ARMv4T lacks BLX, we can approximate its behavior using available instructions.

In ARMv4T, we can:

Use BL (Branch with Link) if the target address is within range.

Use BX (Branch and Exchange) for indirect jumps.

Manually save the return address in LR and jump to a computed address.”

alright, now what did it do with that info:

“Here’s a macro to emulate BLX as closely as possible:”

.macro BLX target
    mov     lr, pc        @ Store return address in LR
    bx      \target       @ Branch to target
.endm

and further:

“This works for indirect jumps where target is a register. If target is an immediate, BX won’t work directly. Instead, we use BL for relative jumps:”

.macro BLX target
    adr     lr, 1f        @ Store return address in LR
    bx      \target       @ Branch to target
1:
.endm

which is bullshit. why do you suddenly use “adr lr, 1f” instead of the correct “mov lr, pc” and using r3 here while being correct in the sense that it fullfills the branch, exchange and link aspects is really terrible. it’ll overload r3, which is commonly used for arguments in function calls or as an intermediate register to process data. so i gave it some more help:

“extend the macro so that it works with registers as well as labels/addresses. keep in mind that the target might be outside the range of a short-range jump.”

and it said:

“To properly handle both register-based and label/address-based targets while ensuring compatibility with ARMv4T, we need to account for the following cases:

Register Targets (bx reg): If the target is a register, we can use BX directly after storing the return address in LR.

Label or Immediate Targets (Far Jumps): If the target is a label or an absolute address, we may need an indirect jump to handle long-range jumps. This means loading the address into a register first before branching.

Here’s a GNU assembler macro that works in both cases:”

.macro BLX target
    .ifc \target, r0     @ Check if target is a register (r0 to r15)
    mov     lr, pc       @ Store return address in LR
    bx      \target      @ Branch to register
    .elseifc \target, r1
    mov     lr, pc
    bx      \target
    .elseifc \target, r2
    mov     lr, pc
    bx      \target
    .elseifc \target, r3
    mov     lr, pc
    bx      \target
    .elseifc \target, r4
    mov     lr, pc
    bx      \target
    .elseifc \target, r5
    mov     lr, pc
    bx      \target
    .elseifc \target, r6
    mov     lr, pc
    bx      \target
    .elseifc \target, r7
    mov     lr, pc
    bx      \target
    .elseifc \target, r8
    mov     lr, pc
    bx      \target
    .elseifc \target, r9
    mov     lr, pc
    bx      \target
    .elseifc \target, r10
    mov     lr, pc
    bx      \target
    .elseifc \target, r11
    mov     lr, pc
    bx      \target
    .elseifc \target, r12
    mov     lr, pc
    bx      \target
    .elseifc \target, r13
    mov     lr, pc
    bx      \target
    .elseifc \target, r14
    mov     lr, pc
    bx      \target
    .elseifc \target, r15
    mov     lr, pc
    bx      \target
    .else                    @ Otherwise, assume a label or address
    adr     lr, 1f           @ Store return address in LR
    ldr     r3, =\target     @ Load target address into a register (use r3 as scratch)
    bx      r3               @ Branch to target
1:
    .endif
.endm

this won’t assemble at all because .elseifc does not exist. rookie mistake ig, so i complained “.elseifc is not a valid pseudo-op” to which it came up with this:

.macro BLX target
    .ifnc \target, r0 && \target, r1 && \target, r2 && \target, r3 && \
          \target, r4 && \target, r5 && \target, r6 && \target, r7 && \
          \target, r8 && \target, r9 && \target, r10 && \target, r11 && \
          \target, r12 && \target, r13 && \target, r14 && \target, r15
    @ Case for label or absolute address
    adr     lr, 1f           @ Store return address in LR
    ldr     r3, =\target     @ Load the target address into r3
    bx      r3               @ Branch to target
1:
    .else
    @ Case for register target
    mov     lr, pc           @ Store return address in LR
    bx      \target          @ Branch to register
    .endif
.endm

which again is nonesense.

the easy solution is to implement a macro that implements

mov lr, pc
bx \target

for all cases where target is a valid register, and

mov lr, pc
ldr pc, =\target

for all the others which your assembler will translate to

mov lr, pc
ldr pc, [pc + ???]

using intermediates to load the full long distance address. from the tip of my tongue this would look like so (but won’t exchange for when target is not a register):

.macro blx target
.ifnc \target, r0
.ifnc \target, r1
.ifnc \target, r2
.ifnc \target, r3
.ifnc \target, r4
.ifnc \target, r5
.ifnc \target, r6
.ifnc \target, r7
.ifnc \target, r8
.ifnc \target, r9
.ifnc \target, r10
.ifnc \target, r11
.ifnc \target, r12
mov lr, pc
ldr pc, =\target
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.else
mov lr, pc
bx \target
.endif
.endm
1
2
4
@lucy @arcana it is ridiculous you don't have a job doing this shit
3
0
5
@sun @arcana wdym this is entry level newb shit cirno_flap
1
0
1
@lucy @arcana most people don't even know how to do it
1
0
2
@sun @arcana apparently that's not a "skill" anyone would be me for otherwise i would get a job yet i don't even get to the interview stage
2
0
1
@lucy @arcana I think that a lot of people just don't need assembly programmers tbh. they're out there of course but
1
0
4
@sun @arcana literally born too late mokouDead had i been born earlier I'd be a rich senior dev by now
0
0
3
@zaitcev @arcana @lucy I have no job but I haven't started looking yet. I am dealing with moving.
0
0
2
@zaitcev @arcana @sun he's unemployed because he's rich and hates work

im unemployed because nobody wants to pay me a living wage

we're not the same sadblob
3
0
0
@lucy @arcana @zaitcev I love work and I am going crazy not working. I am attempting to use my privilege to get back to a new job I don't hate.
1
0
5
@lucy @arcana @sun I see.

FWIW I am on vacation right now because work was literally killing me. I had a sinecure before, and I quit it because management began to suspect it.
0
0
0
@lucy

That’s what you get for not letting Charlie Brown kick the damn football

@arcana @sun @zaitcev
1
1
1
@Leyonhjelm @arcana @sun @zaitcev i was actually named after this character hehecat
0
0
3

Lucy [hiatus era] 𒌋𒁯

i wish any of this would be useful for getting a job saddercat

RE: https://netzsphaere.xyz/objects/74ecc19b-8057-448f-bd8b-731c35cadd92
1
0
2
@lucy @sun getting jobs is a matter of social skills not technical skills. Saying this because you do have strong technical skills, but most employers don’t see that really. I was talking to a therapist specialising in neurodivergence about it recently at a networking event, it’s quite the epidemic
0
0
5
@lucy the fact you did this shows you are quite competent for other things blobcat
0
0
0
@arcana @sun thought this was vietnamese for a second, kind of a letdown
0
0
1