• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Code Puzzle

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by AtW View Post
    Code? You write code? I was pretty sure you were reporting monkey - shush from the thread when real programming languages are used!
    Sorry when I mean commercial, I mean code that people pay for as opposed to pishmercial which seems to consistent of a wall,a marker relating to memory and a worthless exercise in assembler one up man ship

    sorry should have been clearer
    What happens in General, stays in General.
    You know what they say about assumptions!

    Comment


      Originally posted by NickFitz View Post
      Well, AtW's code seems fine, apart from the mode setting (line 2) which looks like a sneaky hack - I'd want some confirmation that it works reliably before putting that into production.

      Apart from that, a very nice bit of work
      You did pretty well too...



      It's undocumented but works for me - considering our dog's insistence that his magical "requirements" were that it runs from debug and therefore setting text video mode isn't even necessary - if this is true then 2 bytes can be saved by removing INT 10H

      I can do it in 43 bytes with guaranteed video mode set - just use: xor ax,ax - 0 mode is valid text mode

      Comment


        Originally posted by MarillionFan View Post
        a worthless exercise in assembler one up man ship
        It wasn't worthless for me actually, not so much as putting the dog in his place (well below cats and squirrels in evolutionary ladder) but brushing up on old stuff - I was planning to rewrite one tight C code using assembly but with new SSE opcodes - frankly Spod could have picked much better ASM example to optimise.

        From all possible choices he picked up 16-bit real mode, and code itself is so trivial that there is no good scope for optimisation other than its size (which is what I had to focus on).

        For a few decades now assembly language was used primarily for speed, not space savings - sometimes these are the same when you try to optimise tight loop to get it to fit into prefetch buffers.

        Comment


          Originally posted by MarillionFan View Post
          ...a worthless exercise in assembler one up man ship
          1. It's "One-upmanship" - if you're going to make allusions to Stephen Potter's work, at least get it right, or you immediately put yourself one-down;

          2. No exercise in assembly language programming is worthless.


          Quick test: given the following values in the address space:

          Code:
          0800 f0
          ---
          08FF dc
          0900 ac
          where and how will the following 6502 code fail:

          Code:
          0FF0 6C FF 08 JMP (08FF)
          This 6502 processor bug actually bit me once, so this is not a theoretical question. Understanding it helped make me a better programmer.

          Mind you, that chap who caught the floating-point division bug in the Pentium has to get the prize for alerting the world to the fact that the leaky abstractions can extend down into the silicon. A high-level reporting language really stands no chance of truly insulating you from the bitter reality of bits and bytes

          Comment


            Well done everyone who contributed - even AtW when he stopped whinging like a fairy.

            As was originally mentioned this wasn't a competition but AtW, Nick I owe you both a beer.

            MarillionFan - I wouldn't expect you to understand.

            Comment


              Originally posted by Churchill View Post
              Well done everyone who contributed - even AtW when he stopped whinging like a fairy.


              As was originally mentioned this wasn't a competition but AtW, Nick I owe you both a beer.
              ta, it's better be a big one - I've spent whole of yesterday evening doing it instead of playing my favourite game, by the time I finished with code Valve's servers were down

              Last edited by AtW; 5 March 2010, 10:04.

              Comment


                Originally posted by AtW View Post




                ta, it's better be a big one - I've spent whole of yesterday evening doing it instead of playing my favourite game, by the time I finished with code Valve's servers were down

                Yeah, I charged 'em to keep you off the servers last night! I can't believe how easy it was!

                Comment


                  Originally posted by Churchill View Post
                  Yeah, I charged 'em to keep you off the servers last night! I can't believe how easy it was!
                  They were working fine whilst I was coding, they failed AFTER I finished and thought I finally can get a quick game

                  Comment


                    well, this thread was great.

                    all that rage over some assembly, classic

                    TM

                    Comment


                      Excellent thread this !!

                      Wish there were more threads like this.

                      Never coded in assembly language so I have no clue what those numbers mean except it proved AtW and Nick are pretty good at what they do.
                      Vote Corbyn ! Save this country !

                      Comment

                      Working...
                      X